stats_test.go 592 B

1234567891011121314151617181920212223242526272829303132
  1. package foodgroup
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. "github.com/mk6i/open-oscar-server/wire"
  7. )
  8. func TestStatsService_ReportEvents(t *testing.T) {
  9. svc := NewStatsService()
  10. frame := wire.SNACFrame{
  11. RequestID: 1234,
  12. }
  13. body := wire.SNAC_0x0B_0x03_StatsReportEvents{}
  14. have := svc.ReportEvents(context.Background(), frame, body)
  15. want := wire.SNACMessage{
  16. Frame: wire.SNACFrame{
  17. FoodGroup: wire.Stats,
  18. SubGroup: wire.StatsReportAck,
  19. RequestID: 1234,
  20. },
  21. Body: wire.SNAC_0x0B_0x04_StatsReportAck{},
  22. }
  23. assert.Equal(t, want, have)
  24. }