Documentation
¶
Index ¶
- type PermissionsStoreMock
- func (mock *PermissionsStoreMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (mock *PermissionsStoreMock) CheckerCalls() []struct{ ... }
- func (mock *PermissionsStoreMock) Close(ctx context.Context) error
- func (mock *PermissionsStoreMock) CloseCalls() []struct{ ... }
- func (mock *PermissionsStoreMock) GetRole(ctx context.Context, id string) (*models.Role, error)
- func (mock *PermissionsStoreMock) GetRoleCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PermissionsStoreMock ¶
type PermissionsStoreMock struct {
// CheckerFunc mocks the Checker method.
CheckerFunc func(ctx context.Context, state *healthcheck.CheckState) error
// CloseFunc mocks the Close method.
CloseFunc func(ctx context.Context) error
// GetRoleFunc mocks the GetRole method.
GetRoleFunc func(ctx context.Context, id string) (*models.Role, error)
// contains filtered or unexported fields
}
PermissionsStoreMock is a mock implementation of api.PermissionsStore.
func TestSomethingThatUsesPermissionsStore(t *testing.T) {
// make and configure a mocked api.PermissionsStore
mockedPermissionsStore := &PermissionsStoreMock{
CheckerFunc: func(ctx context.Context, state *healthcheck.CheckState) error {
panic("mock out the Checker method")
},
CloseFunc: func(ctx context.Context) error {
panic("mock out the Close method")
},
GetRoleFunc: func(ctx context.Context, id string) (*models.Role, error) {
panic("mock out the GetRole method")
},
}
// use mockedPermissionsStore in code that requires api.PermissionsStore
// and then make assertions.
}
func (*PermissionsStoreMock) Checker ¶
func (mock *PermissionsStoreMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*PermissionsStoreMock) CheckerCalls ¶
func (mock *PermissionsStoreMock) CheckerCalls() []struct { Ctx context.Context State *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedPermissionsStore.CheckerCalls())
func (*PermissionsStoreMock) Close ¶
func (mock *PermissionsStoreMock) Close(ctx context.Context) error
Close calls CloseFunc.
func (*PermissionsStoreMock) CloseCalls ¶
func (mock *PermissionsStoreMock) CloseCalls() []struct { Ctx context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedPermissionsStore.CloseCalls())
func (*PermissionsStoreMock) GetRoleCalls ¶
func (mock *PermissionsStoreMock) GetRoleCalls() []struct { Ctx context.Context ID string }
GetRoleCalls gets all the calls that were made to GetRole. Check the length with:
len(mockedPermissionsStore.GetRoleCalls())
Click to show internal directories.
Click to hide internal directories.