buddy_test.go 855 B

123456789101112131415161718192021222324252627282930313233
  1. package handler
  2. import (
  3. "testing"
  4. "github.com/mk6i/retro-aim-server/oscar"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestBuddyService_RightsQueryHandler(t *testing.T) {
  8. svc := NewBuddyService()
  9. want := oscar.SNACMessage{
  10. Frame: oscar.SNACFrame{
  11. FoodGroup: oscar.Buddy,
  12. SubGroup: oscar.BuddyRightsReply,
  13. RequestID: 1234,
  14. },
  15. Body: oscar.SNAC_0x03_0x03_BuddyRightsReply{
  16. TLVRestBlock: oscar.TLVRestBlock{
  17. TLVList: oscar.TLVList{
  18. oscar.NewTLV(oscar.BuddyTLVTagsParmMaxBuddies, uint16(100)),
  19. oscar.NewTLV(oscar.BuddyTLVTagsParmMaxWatchers, uint16(100)),
  20. oscar.NewTLV(oscar.BuddyTLVTagsParmMaxIcqBroad, uint16(100)),
  21. oscar.NewTLV(oscar.BuddyTLVTagsParmMaxTempBuddies, uint16(100)),
  22. },
  23. },
  24. },
  25. }
  26. have := svc.RightsQueryHandler(nil, oscar.SNACFrame{RequestID: 1234})
  27. assert.Equal(t, want, have)
  28. }