Documentation ¶
Overview ¶
Package user is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) Get ¶
func (mr *MockRepositoryMockRecorder) Get(ctx, id interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockRepositoryMockRecorder) Save ¶
func (mr *MockRepositoryMockRecorder) Save(ctx, user interface{}) *gomock.Call
Save indicates an expected call of Save.
type Repository ¶
type RepositoryMock ¶
type RepositoryMock struct { // GetFunc mocks the Get method. GetFunc func(ctx context.Context, id uuid.UUID) (User, error) // SaveFunc mocks the Save method. SaveFunc func(ctx context.Context, user User) error // contains filtered or unexported fields }
RepositoryMock is a mock implementation of Repository.
func TestSomethingThatUsesRepository(t *testing.T) { // make and configure a mocked Repository mockedRepository := &RepositoryMock{ GetFunc: func(ctx context.Context, id uuid.UUID) (User, error) { panic("mock out the Get method") }, SaveFunc: func(ctx context.Context, user User) error { panic("mock out the Save method") }, } // use mockedRepository in code that requires Repository // and then make assertions. }
func (*RepositoryMock) GetCalls ¶
func (mock *RepositoryMock) GetCalls() []struct { Ctx context.Context ID uuid.UUID }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedRepository.GetCalls())
Click to show internal directories.
Click to hide internal directories.