mocks

package
v0.0.0-...-dcedfe7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockJSONPost

func MockJSONPost(c *gin.Context, content interface{})

MockJSONPost mock test for context with json

Types

type MockImageRepository

type MockImageRepository struct {
	mock.Mock
}

MockImageRepository is a mock type for model.ImageRepository

func (*MockImageRepository) DeleteProfile

func (m *MockImageRepository) DeleteProfile(ctx context.Context, objName string) error

DeleteProfile is mock of representations of ImageRepository DeleteProfile

func (*MockImageRepository) UpdateProfile

func (m *MockImageRepository) UpdateProfile(ctx context.Context, objName string, imageFile multipart.File) (string, error)

UpdateProfile is mock of representations of ImageRepository Update Profile

type MockTokenRepository

type MockTokenRepository struct {
	mock.Mock
}

MockTokenRepository is a mock type for model.TokenRepository

func (*MockTokenRepository) DeleteRefreshToken

func (m *MockTokenRepository) DeleteRefreshToken(ctx context.Context, userID string, prevTokenID string) error

DeleteRefreshToken is a mock of model.TokenRepository DeleteRefreshToken

func (*MockTokenRepository) DeleteUserRefreshToken

func (m *MockTokenRepository) DeleteUserRefreshToken(ctx context.Context, userID string) error

DeleteUserRefreshToken mocks concrete DeleteUserRefreshToken

func (*MockTokenRepository) SetRefreshToken

func (m *MockTokenRepository) SetRefreshToken(ctx context.Context, userID string, tokenID string, expiresIn time.Duration) error

SetRefreshToken is a mock of model.TokenRepository SetRefreshToken

type MockTokenService

type MockTokenService struct {
	mock.Mock
}

MockTokenService is a mock type for model.TokenService

func (*MockTokenService) NewPairFromUser

func (m *MockTokenService) NewPairFromUser(ctx context.Context, u *model.User, prevTokenID string) (*model.Token, error)

NewPairFromUser mocks concrete NewPairFromUser

func (*MockTokenService) Signout

func (m *MockTokenService) Signout(ctx context.Context, uid uuid.UUID) error

Signout mocks concrete Signout

func (*MockTokenService) ValidateIDToken

func (m *MockTokenService) ValidateIDToken(tokenString string) (*model.User, error)

ValidateIDToken mocks concrete ValidateIDToken

func (*MockTokenService) ValidateRefreshToken

func (m *MockTokenService) ValidateRefreshToken(refreshTokenString string) (*model.RefreshToken, error)

ValidateRefreshToken mocks concrete ValidateRefreshToken

type MockUserRepository

type MockUserRepository struct {
	mock.Mock
}

MockUserRepository is a mock type for model.UserRepository

func (*MockUserRepository) Create

func (m *MockUserRepository) Create(ctx context.Context, user *model.User) error

Create is a mock for UserRepository Create

func (*MockUserRepository) FindByEmail

func (m *MockUserRepository) FindByEmail(ctx context.Context, email string) (*model.User, error)

FindByEmail is mock of UserRepository.FindByEmail

func (*MockUserRepository) FindByID

func (m *MockUserRepository) FindByID(ctx context.Context, uid uuid.UUID) (*model.User, error)

FindByID is mock of UserRepository FindByID

func (*MockUserRepository) Update

func (m *MockUserRepository) Update(ctx context.Context, u *model.User) error

Update is mock of UserRepository.Update

func (*MockUserRepository) UpdateImage

func (m *MockUserRepository) UpdateImage(
	ctx context.Context,
	uid uuid.UUID,
	imageURL string,
) (*model.User, error)

UpdateImage is mock of UserRepository.UpdateImage, duh

type MockUserService

type MockUserService struct {
	mock.Mock
}

MockUserService is a mock type for model.UserService

func (*MockUserService) DeleteProfileImage

func (m *MockUserService) DeleteProfileImage(ctx context.Context, uid uuid.UUID) error

DeleteProfileImage is a mock of UserService.DeleteProfileImage

func (*MockUserService) Get

func (m *MockUserService) Get(ctx context.Context, uid uuid.UUID) (*model.User, error)

Get is mock of UserService Get

func (*MockUserService) SetProfileImage

func (m *MockUserService) SetProfileImage(
	ctx context.Context,
	uid uuid.UUID,
	imageFileHeader *multipart.FileHeader,
) (*model.User, error)

SetProfileImage is a mock of UserService.SetProfileImage

func (*MockUserService) Signin

func (m *MockUserService) Signin(ctx context.Context, u *model.User) error

Signin is a mock of UserService.Signup

func (*MockUserService) Signup

func (m *MockUserService) Signup(ctx context.Context, u *model.User) error

Signup is a mock of UserService.Signup

func (*MockUserService) UpdateDetails

func (m *MockUserService) UpdateDetails(ctx context.Context, u *model.User) error

UpdateDetails is a mock of UserService.UpdateDetails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL