Documentation ¶
Index ¶
- type UseCaseMock
- func (mock *UseCaseMock) CreateAuthUser(ctx context.Context, f *firestore.Client, input *model.NewAuthUser, ...) (string, error)
- func (mock *UseCaseMock) CreateAuthUserCalls() []struct{ ... }
- func (mock *UseCaseMock) DeleteAuthUser(ctx context.Context, f *firestore.Client, uid string) error
- func (mock *UseCaseMock) DeleteAuthUserCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UseCaseMock ¶
type UseCaseMock struct { // CreateAuthUserFunc mocks the CreateAuthUser method. CreateAuthUserFunc func(ctx context.Context, f *firestore.Client, input *model.NewAuthUser, u *repository.User, mu *model.AuthUser) (string, error) // DeleteAuthUserFunc mocks the DeleteAuthUser method. DeleteAuthUserFunc func(ctx context.Context, f *firestore.Client, uid string) error // contains filtered or unexported fields }
UseCaseMock is a mock implementation of auth.UseCase.
func TestSomethingThatUsesUseCase(t *testing.T) { // make and configure a mocked auth.UseCase mockedUseCase := &UseCaseMock{ CreateAuthUserFunc: func(ctx context.Context, f *firestore.Client, input *model.NewAuthUser, u *repository.User, mu *model.AuthUser) (string, error) { panic("mock out the CreateAuthUser method") }, DeleteAuthUserFunc: func(ctx context.Context, f *firestore.Client, uid string) error { panic("mock out the DeleteAuthUser method") }, } // use mockedUseCase in code that requires auth.UseCase // and then make assertions. }
func (*UseCaseMock) CreateAuthUser ¶
func (mock *UseCaseMock) CreateAuthUser(ctx context.Context, f *firestore.Client, input *model.NewAuthUser, u *repository.User, mu *model.AuthUser) (string, error)
CreateAuthUser calls CreateAuthUserFunc.
func (*UseCaseMock) CreateAuthUserCalls ¶
func (mock *UseCaseMock) CreateAuthUserCalls() []struct { Ctx context.Context F *firestore.Client Input *model.NewAuthUser U *repository.User Mu *model.AuthUser }
CreateAuthUserCalls gets all the calls that were made to CreateAuthUser. Check the length with:
len(mockedUseCase.CreateAuthUserCalls())
func (*UseCaseMock) DeleteAuthUser ¶
DeleteAuthUser calls DeleteAuthUserFunc.
func (*UseCaseMock) DeleteAuthUserCalls ¶
func (mock *UseCaseMock) DeleteAuthUserCalls() []struct { Ctx context.Context F *firestore.Client UID string }
DeleteAuthUserCalls gets all the calls that were made to DeleteAuthUser. Check the length with:
len(mockedUseCase.DeleteAuthUserCalls())
Click to show internal directories.
Click to hide internal directories.