Documentation ¶
Index ¶
- type SportsVenueService
- type SportsVenueServiceMock
- func (mock *SportsVenueServiceMock) Broker() string
- func (mock *SportsVenueServiceMock) BrokerCalls() []struct{}
- func (mock *SportsVenueServiceMock) GetAll(requiredCategories []string) []domain.SportsVenue
- func (mock *SportsVenueServiceMock) GetAllCalls() []struct{ ... }
- func (mock *SportsVenueServiceMock) GetByID(id string) (*domain.SportsVenue, error)
- func (mock *SportsVenueServiceMock) GetByIDCalls() []struct{ ... }
- func (mock *SportsVenueServiceMock) Shutdown(ctx context.Context)
- func (mock *SportsVenueServiceMock) ShutdownCalls() []struct{ ... }
- func (mock *SportsVenueServiceMock) Start(ctx context.Context)
- func (mock *SportsVenueServiceMock) StartCalls() []struct{ ... }
- func (mock *SportsVenueServiceMock) Tenant() string
- func (mock *SportsVenueServiceMock) TenantCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SportsVenueService ¶
type SportsVenueService interface { Broker() string Tenant() string GetAll(requiredCategories []string) []domain.SportsVenue GetByID(id string) (*domain.SportsVenue, error) Start(ctx context.Context) Shutdown(ctx context.Context) }
func NewSportsVenueService ¶
func NewSportsVenueService(ctx context.Context, contextBrokerURL, tenant string, orgreg organisations.Registry) SportsVenueService
type SportsVenueServiceMock ¶
type SportsVenueServiceMock struct { // BrokerFunc mocks the Broker method. BrokerFunc func() string // GetAllFunc mocks the GetAll method. GetAllFunc func(requiredCategories []string) []domain.SportsVenue // GetByIDFunc mocks the GetByID method. GetByIDFunc func(id string) (*domain.SportsVenue, error) // ShutdownFunc mocks the Shutdown method. ShutdownFunc func(ctx context.Context) // StartFunc mocks the Start method. StartFunc func(ctx context.Context) // TenantFunc mocks the Tenant method. TenantFunc func() string // contains filtered or unexported fields }
SportsVenueServiceMock is a mock implementation of SportsVenueService.
func TestSomethingThatUsesSportsVenueService(t *testing.T) { // make and configure a mocked SportsVenueService mockedSportsVenueService := &SportsVenueServiceMock{ BrokerFunc: func() string { panic("mock out the Broker method") }, GetAllFunc: func(requiredCategories []string) []domain.SportsVenue { panic("mock out the GetAll method") }, GetByIDFunc: func(id string) (*domain.SportsVenue, error) { panic("mock out the GetByID method") }, ShutdownFunc: func(ctx context.Context) { panic("mock out the Shutdown method") }, StartFunc: func(ctx context.Context) { panic("mock out the Start method") }, TenantFunc: func() string { panic("mock out the Tenant method") }, } // use mockedSportsVenueService in code that requires SportsVenueService // and then make assertions. }
func (*SportsVenueServiceMock) Broker ¶
func (mock *SportsVenueServiceMock) Broker() string
Broker calls BrokerFunc.
func (*SportsVenueServiceMock) BrokerCalls ¶
func (mock *SportsVenueServiceMock) BrokerCalls() []struct { }
BrokerCalls gets all the calls that were made to Broker. Check the length with:
len(mockedSportsVenueService.BrokerCalls())
func (*SportsVenueServiceMock) GetAll ¶
func (mock *SportsVenueServiceMock) GetAll(requiredCategories []string) []domain.SportsVenue
GetAll calls GetAllFunc.
func (*SportsVenueServiceMock) GetAllCalls ¶
func (mock *SportsVenueServiceMock) GetAllCalls() []struct { RequiredCategories []string }
GetAllCalls gets all the calls that were made to GetAll. Check the length with:
len(mockedSportsVenueService.GetAllCalls())
func (*SportsVenueServiceMock) GetByID ¶
func (mock *SportsVenueServiceMock) GetByID(id string) (*domain.SportsVenue, error)
GetByID calls GetByIDFunc.
func (*SportsVenueServiceMock) GetByIDCalls ¶
func (mock *SportsVenueServiceMock) GetByIDCalls() []struct { ID string }
GetByIDCalls gets all the calls that were made to GetByID. Check the length with:
len(mockedSportsVenueService.GetByIDCalls())
func (*SportsVenueServiceMock) Shutdown ¶
func (mock *SportsVenueServiceMock) Shutdown(ctx context.Context)
Shutdown calls ShutdownFunc.
func (*SportsVenueServiceMock) ShutdownCalls ¶
func (mock *SportsVenueServiceMock) ShutdownCalls() []struct { Ctx context.Context }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedSportsVenueService.ShutdownCalls())
func (*SportsVenueServiceMock) Start ¶
func (mock *SportsVenueServiceMock) Start(ctx context.Context)
Start calls StartFunc.
func (*SportsVenueServiceMock) StartCalls ¶
func (mock *SportsVenueServiceMock) StartCalls() []struct { Ctx context.Context }
StartCalls gets all the calls that were made to Start. Check the length with:
len(mockedSportsVenueService.StartCalls())
func (*SportsVenueServiceMock) Tenant ¶
func (mock *SportsVenueServiceMock) Tenant() string
Tenant calls TenantFunc.
func (*SportsVenueServiceMock) TenantCalls ¶
func (mock *SportsVenueServiceMock) TenantCalls() []struct { }
TenantCalls gets all the calls that were made to Tenant. Check the length with:
len(mockedSportsVenueService.TenantCalls())