Documentation
¶
Index ¶
- type AreaStoreMock
- func (mock *AreaStoreMock) CheckAreaExists(id string) error
- func (mock *AreaStoreMock) CheckAreaExistsCalls() []struct{ ... }
- func (mock *AreaStoreMock) Checker(in1 context.Context, in2 *healthcheck.CheckState) error
- func (mock *AreaStoreMock) CheckerCalls() []struct{ ... }
- func (mock *AreaStoreMock) Close(ctx context.Context) error
- func (mock *AreaStoreMock) CloseCalls() []struct{ ... }
- func (mock *AreaStoreMock) GetArea(ctx context.Context, id string) (*models.Area, error)
- func (mock *AreaStoreMock) GetAreaCalls() []struct{ ... }
- func (mock *AreaStoreMock) GetAreas(ctx context.Context, offset int, limit int) (*models.AreasResults, error)
- func (mock *AreaStoreMock) GetAreasCalls() []struct{ ... }
- func (mock *AreaStoreMock) GetVersion(id string, versionID int) (*models.Area, error)
- func (mock *AreaStoreMock) GetVersionCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaStoreMock ¶
type AreaStoreMock struct {
// CheckAreaExistsFunc mocks the CheckAreaExists method.
CheckAreaExistsFunc func(id string) error
// CheckerFunc mocks the Checker method.
CheckerFunc func(in1 context.Context, in2 *healthcheck.CheckState) error
// CloseFunc mocks the Close method.
CloseFunc func(ctx context.Context) error
// GetAreaFunc mocks the GetArea method.
GetAreaFunc func(ctx context.Context, id string) (*models.Area, error)
// GetAreasFunc mocks the GetAreas method.
GetAreasFunc func(ctx context.Context, offset int, limit int) (*models.AreasResults, error)
// GetVersionFunc mocks the GetVersion method.
GetVersionFunc func(id string, versionID int) (*models.Area, error)
// contains filtered or unexported fields
}
AreaStoreMock is a mock implementation of api.AreaStore.
func TestSomethingThatUsesAreaStore(t *testing.T) {
// make and configure a mocked api.AreaStore
mockedAreaStore := &AreaStoreMock{
CheckAreaExistsFunc: func(id string) error {
panic("mock out the CheckAreaExists method")
},
CheckerFunc: func(in1 context.Context, in2 *healthcheck.CheckState) error {
panic("mock out the Checker method")
},
CloseFunc: func(ctx context.Context) error {
panic("mock out the Close method")
},
GetAreaFunc: func(ctx context.Context, id string) (*models.Area, error) {
panic("mock out the GetArea method")
},
GetAreasFunc: func(ctx context.Context, offset int, limit int) (*models.AreasResults, error) {
panic("mock out the GetAreas method")
},
GetVersionFunc: func(id string, versionID int) (*models.Area, error) {
panic("mock out the GetVersion method")
},
}
// use mockedAreaStore in code that requires api.AreaStore
// and then make assertions.
}
func (*AreaStoreMock) CheckAreaExists ¶
func (mock *AreaStoreMock) CheckAreaExists(id string) error
CheckAreaExists calls CheckAreaExistsFunc.
func (*AreaStoreMock) CheckAreaExistsCalls ¶
func (mock *AreaStoreMock) CheckAreaExistsCalls() []struct { ID string }
CheckAreaExistsCalls gets all the calls that were made to CheckAreaExists. Check the length with:
len(mockedAreaStore.CheckAreaExistsCalls())
func (*AreaStoreMock) Checker ¶
func (mock *AreaStoreMock) Checker(in1 context.Context, in2 *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*AreaStoreMock) CheckerCalls ¶
func (mock *AreaStoreMock) CheckerCalls() []struct { In1 context.Context In2 *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedAreaStore.CheckerCalls())
func (*AreaStoreMock) Close ¶
func (mock *AreaStoreMock) Close(ctx context.Context) error
Close calls CloseFunc.
func (*AreaStoreMock) CloseCalls ¶
func (mock *AreaStoreMock) CloseCalls() []struct { Ctx context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedAreaStore.CloseCalls())
func (*AreaStoreMock) GetAreaCalls ¶
func (mock *AreaStoreMock) GetAreaCalls() []struct { Ctx context.Context ID string }
GetAreaCalls gets all the calls that were made to GetArea. Check the length with:
len(mockedAreaStore.GetAreaCalls())
func (*AreaStoreMock) GetAreas ¶
func (mock *AreaStoreMock) GetAreas(ctx context.Context, offset int, limit int) (*models.AreasResults, error)
GetAreas calls GetAreasFunc.
func (*AreaStoreMock) GetAreasCalls ¶
func (mock *AreaStoreMock) GetAreasCalls() []struct { Ctx context.Context Offset int Limit int }
GetAreasCalls gets all the calls that were made to GetAreas. Check the length with:
len(mockedAreaStore.GetAreasCalls())
func (*AreaStoreMock) GetVersion ¶
GetVersion calls GetVersionFunc.
func (*AreaStoreMock) GetVersionCalls ¶
func (mock *AreaStoreMock) GetVersionCalls() []struct { ID string VersionID int }
GetVersionCalls gets all the calls that were made to GetVersion. Check the length with:
len(mockedAreaStore.GetVersionCalls())