mocks_test.go 781 B

12345678910111213141516171819202122232425
  1. package handlers
  2. import (
  3. "context"
  4. "github.com/stretchr/testify/mock"
  5. "github.com/mk6i/open-oscar-server/state"
  6. "github.com/mk6i/open-oscar-server/wire"
  7. )
  8. // MockLocateService is a mock implementation of LocateService
  9. type MockLocateService struct {
  10. mock.Mock
  11. }
  12. func (m *MockLocateService) SetInfo(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x02_0x04_LocateSetInfo) error {
  13. args := m.Called(ctx, instance, inBody)
  14. return args.Error(0)
  15. }
  16. func (m *MockLocateService) UserInfoQuery(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error) {
  17. args := m.Called(ctx, instance, inFrame, inBody)
  18. return args.Get(0).(wire.SNACMessage), args.Error(1)
  19. }