Documentation ¶
Index ¶
- type ExerciseTrailService
- type ExerciseTrailServiceMock
- func (mock *ExerciseTrailServiceMock) Broker() string
- func (mock *ExerciseTrailServiceMock) BrokerCalls() []struct{}
- func (mock *ExerciseTrailServiceMock) GetAll(requiredCategories []string) []domain.ExerciseTrail
- func (mock *ExerciseTrailServiceMock) GetAllCalls() []struct{ ... }
- func (mock *ExerciseTrailServiceMock) GetByID(id string) (*domain.ExerciseTrail, error)
- func (mock *ExerciseTrailServiceMock) GetByIDCalls() []struct{ ... }
- func (mock *ExerciseTrailServiceMock) Shutdown(ctx context.Context)
- func (mock *ExerciseTrailServiceMock) ShutdownCalls() []struct{ ... }
- func (mock *ExerciseTrailServiceMock) Start(ctx context.Context)
- func (mock *ExerciseTrailServiceMock) StartCalls() []struct{ ... }
- func (mock *ExerciseTrailServiceMock) Tenant() string
- func (mock *ExerciseTrailServiceMock) TenantCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExerciseTrailService ¶
type ExerciseTrailService interface { Broker() string Tenant() string GetAll(requiredCategories []string) []domain.ExerciseTrail GetByID(id string) (*domain.ExerciseTrail, error) Start(ctx context.Context) Shutdown(ctx context.Context) }
func NewExerciseTrailService ¶
func NewExerciseTrailService(ctx context.Context, contextBrokerURL, tenant string, orgreg organisations.Registry) ExerciseTrailService
type ExerciseTrailServiceMock ¶
type ExerciseTrailServiceMock struct { // BrokerFunc mocks the Broker method. BrokerFunc func() string // GetAllFunc mocks the GetAll method. GetAllFunc func(requiredCategories []string) []domain.ExerciseTrail // GetByIDFunc mocks the GetByID method. GetByIDFunc func(id string) (*domain.ExerciseTrail, 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 }
ExerciseTrailServiceMock is a mock implementation of ExerciseTrailService.
func TestSomethingThatUsesExerciseTrailService(t *testing.T) { // make and configure a mocked ExerciseTrailService mockedExerciseTrailService := &ExerciseTrailServiceMock{ BrokerFunc: func() string { panic("mock out the Broker method") }, GetAllFunc: func(requiredCategories []string) []domain.ExerciseTrail { panic("mock out the GetAll method") }, GetByIDFunc: func(id string) (*domain.ExerciseTrail, 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 mockedExerciseTrailService in code that requires ExerciseTrailService // and then make assertions. }
func (*ExerciseTrailServiceMock) Broker ¶
func (mock *ExerciseTrailServiceMock) Broker() string
Broker calls BrokerFunc.
func (*ExerciseTrailServiceMock) BrokerCalls ¶
func (mock *ExerciseTrailServiceMock) BrokerCalls() []struct { }
BrokerCalls gets all the calls that were made to Broker. Check the length with:
len(mockedExerciseTrailService.BrokerCalls())
func (*ExerciseTrailServiceMock) GetAll ¶
func (mock *ExerciseTrailServiceMock) GetAll(requiredCategories []string) []domain.ExerciseTrail
GetAll calls GetAllFunc.
func (*ExerciseTrailServiceMock) GetAllCalls ¶
func (mock *ExerciseTrailServiceMock) GetAllCalls() []struct { RequiredCategories []string }
GetAllCalls gets all the calls that were made to GetAll. Check the length with:
len(mockedExerciseTrailService.GetAllCalls())
func (*ExerciseTrailServiceMock) GetByID ¶
func (mock *ExerciseTrailServiceMock) GetByID(id string) (*domain.ExerciseTrail, error)
GetByID calls GetByIDFunc.
func (*ExerciseTrailServiceMock) GetByIDCalls ¶
func (mock *ExerciseTrailServiceMock) GetByIDCalls() []struct { ID string }
GetByIDCalls gets all the calls that were made to GetByID. Check the length with:
len(mockedExerciseTrailService.GetByIDCalls())
func (*ExerciseTrailServiceMock) Shutdown ¶
func (mock *ExerciseTrailServiceMock) Shutdown(ctx context.Context)
Shutdown calls ShutdownFunc.
func (*ExerciseTrailServiceMock) ShutdownCalls ¶
func (mock *ExerciseTrailServiceMock) ShutdownCalls() []struct { Ctx context.Context }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedExerciseTrailService.ShutdownCalls())
func (*ExerciseTrailServiceMock) Start ¶
func (mock *ExerciseTrailServiceMock) Start(ctx context.Context)
Start calls StartFunc.
func (*ExerciseTrailServiceMock) StartCalls ¶
func (mock *ExerciseTrailServiceMock) StartCalls() []struct { Ctx context.Context }
StartCalls gets all the calls that were made to Start. Check the length with:
len(mockedExerciseTrailService.StartCalls())
func (*ExerciseTrailServiceMock) Tenant ¶
func (mock *ExerciseTrailServiceMock) Tenant() string
Tenant calls TenantFunc.
func (*ExerciseTrailServiceMock) TenantCalls ¶
func (mock *ExerciseTrailServiceMock) TenantCalls() []struct { }
TenantCalls gets all the calls that were made to Tenant. Check the length with:
len(mockedExerciseTrailService.TenantCalls())