Documentation
¶
Index ¶
- type MongoDBMock
- func (mock *MongoDBMock) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
- func (mock *MongoDBMock) CheckAllBundleContentsAreApprovedCalls() []struct{ ... }
- func (mock *MongoDBMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
- func (mock *MongoDBMock) CheckerCalls() []struct{ ... }
- func (mock *MongoDBMock) Close(contextMoqParam context.Context) error
- func (mock *MongoDBMock) CloseCalls() []struct{ ... }
- func (mock *MongoDBMock) ListBundles(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error)
- func (mock *MongoDBMock) ListBundlesCalls() []struct{ ... }
- type StorerMock
- func (mock *StorerMock) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
- func (mock *StorerMock) CheckAllBundleContentsAreApprovedCalls() []struct{ ... }
- func (mock *StorerMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (mock *StorerMock) CheckerCalls() []struct{ ... }
- func (mock *StorerMock) Close(ctx context.Context) error
- func (mock *StorerMock) CloseCalls() []struct{ ... }
- func (mock *StorerMock) ListBundles(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error)
- func (mock *StorerMock) ListBundlesCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBMock ¶
type MongoDBMock struct {
// CheckAllBundleContentsAreApprovedFunc mocks the CheckAllBundleContentsAreApproved method.
CheckAllBundleContentsAreApprovedFunc func(ctx context.Context, bundleID string) (bool, error)
// CheckerFunc mocks the Checker method.
CheckerFunc func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
// CloseFunc mocks the Close method.
CloseFunc func(contextMoqParam context.Context) error
// ListBundlesFunc mocks the ListBundles method.
ListBundlesFunc func(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error)
// contains filtered or unexported fields
}
MongoDBMock is a mock implementation of store.MongoDB.
func TestSomethingThatUsesMongoDB(t *testing.T) {
// make and configure a mocked store.MongoDB
mockedMongoDB := &MongoDBMock{
CheckAllBundleContentsAreApprovedFunc: func(ctx context.Context, bundleID string) (bool, error) {
panic("mock out the CheckAllBundleContentsAreApproved method")
},
CheckerFunc: func(contextMoqParam context.Context, checkState *healthcheck.CheckState) error {
panic("mock out the Checker method")
},
CloseFunc: func(contextMoqParam context.Context) error {
panic("mock out the Close method")
},
ListBundlesFunc: func(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error) {
panic("mock out the ListBundles method")
},
}
// use mockedMongoDB in code that requires store.MongoDB
// and then make assertions.
}
func (*MongoDBMock) CheckAllBundleContentsAreApproved ¶ added in v1.2.0
func (mock *MongoDBMock) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
CheckAllBundleContentsAreApproved calls CheckAllBundleContentsAreApprovedFunc.
func (*MongoDBMock) CheckAllBundleContentsAreApprovedCalls ¶ added in v1.2.0
func (mock *MongoDBMock) CheckAllBundleContentsAreApprovedCalls() []struct { Ctx context.Context BundleID string }
CheckAllBundleContentsAreApprovedCalls gets all the calls that were made to CheckAllBundleContentsAreApproved. Check the length with:
len(mockedMongoDB.CheckAllBundleContentsAreApprovedCalls())
func (*MongoDBMock) Checker ¶
func (mock *MongoDBMock) Checker(contextMoqParam context.Context, checkState *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*MongoDBMock) CheckerCalls ¶
func (mock *MongoDBMock) CheckerCalls() []struct { ContextMoqParam context.Context CheckState *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedMongoDB.CheckerCalls())
func (*MongoDBMock) Close ¶
func (mock *MongoDBMock) Close(contextMoqParam context.Context) error
Close calls CloseFunc.
func (*MongoDBMock) CloseCalls ¶
func (mock *MongoDBMock) CloseCalls() []struct { ContextMoqParam context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedMongoDB.CloseCalls())
func (*MongoDBMock) ListBundles ¶
func (mock *MongoDBMock) ListBundles(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error)
ListBundles calls ListBundlesFunc.
func (*MongoDBMock) ListBundlesCalls ¶
func (mock *MongoDBMock) ListBundlesCalls() []struct { Ctx context.Context Offset int Limit int }
ListBundlesCalls gets all the calls that were made to ListBundles. Check the length with:
len(mockedMongoDB.ListBundlesCalls())
type StorerMock ¶
type StorerMock struct {
// CheckAllBundleContentsAreApprovedFunc mocks the CheckAllBundleContentsAreApproved method.
CheckAllBundleContentsAreApprovedFunc func(ctx context.Context, bundleID string) (bool, error)
// 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
// ListBundlesFunc mocks the ListBundles method.
ListBundlesFunc func(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error)
// contains filtered or unexported fields
}
StorerMock is a mock implementation of store.Storer.
func TestSomethingThatUsesStorer(t *testing.T) {
// make and configure a mocked store.Storer
mockedStorer := &StorerMock{
CheckAllBundleContentsAreApprovedFunc: func(ctx context.Context, bundleID string) (bool, error) {
panic("mock out the CheckAllBundleContentsAreApproved method")
},
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")
},
ListBundlesFunc: func(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error) {
panic("mock out the ListBundles method")
},
}
// use mockedStorer in code that requires store.Storer
// and then make assertions.
}
func (*StorerMock) CheckAllBundleContentsAreApproved ¶ added in v1.2.0
func (mock *StorerMock) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
CheckAllBundleContentsAreApproved calls CheckAllBundleContentsAreApprovedFunc.
func (*StorerMock) CheckAllBundleContentsAreApprovedCalls ¶ added in v1.2.0
func (mock *StorerMock) CheckAllBundleContentsAreApprovedCalls() []struct { Ctx context.Context BundleID string }
CheckAllBundleContentsAreApprovedCalls gets all the calls that were made to CheckAllBundleContentsAreApproved. Check the length with:
len(mockedStorer.CheckAllBundleContentsAreApprovedCalls())
func (*StorerMock) Checker ¶
func (mock *StorerMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*StorerMock) CheckerCalls ¶
func (mock *StorerMock) CheckerCalls() []struct { Ctx context.Context State *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedStorer.CheckerCalls())
func (*StorerMock) Close ¶
func (mock *StorerMock) Close(ctx context.Context) error
Close calls CloseFunc.
func (*StorerMock) CloseCalls ¶
func (mock *StorerMock) CloseCalls() []struct { Ctx context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedStorer.CloseCalls())
func (*StorerMock) ListBundles ¶
func (mock *StorerMock) ListBundles(ctx context.Context, offset int, limit int) ([]*models.Bundle, int, error)
ListBundles calls ListBundlesFunc.
func (*StorerMock) ListBundlesCalls ¶
func (mock *StorerMock) ListBundlesCalls() []struct { Ctx context.Context Offset int Limit int }
ListBundlesCalls gets all the calls that were made to ListBundles. Check the length with:
len(mockedStorer.ListBundlesCalls())