mock

package
v0.0.0-...-35a8602 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStoreMock

type DataStoreMock struct {
	MockRegisterUserFn                func(ctx context.Context, user *domain.User, contact *domain.Contact, identifier *domain.Identifier) error
	MockSaveOTPFn                     func(ctx context.Context, otp *domain.OTP) error
	MockSavePINFn                     func(ctx context.Context, pinInput *domain.UserPIN) (bool, error)
	MockGetUserProfileByUserIDFn      func(ctx context.Context, userID string) (*domain.User, error)
	MockGetUserProfileByPhoneNumberFn func(ctx context.Context, phoneNumber string, flavour enums.Flavour) (*domain.User, error)
	MockGetUserPINByUserIDFn          func(ctx context.Context, userID string, flavour enums.Flavour) (*domain.UserPIN, error)
	MockGetUserResidencesByUserIDFn   func(ctx context.Context, userID string) ([]*domain.Residence, error)
	MockInvalidatePINFn               func(ctx context.Context, userID string, flavour enums.Flavour) (bool, error)
	MockCreateResidenceFn             func(ctx context.Context, payload domain.Residence) (*domain.Residence, error)
	MockSearchUserFn                  func(ctx context.Context, searchTerm string) ([]*domain.User, error)
	MockUpdateUserFn                  func(ctx context.Context, user *domain.User, updateData map[string]interface{}) (bool, error)
	MockListHousesInResidenceFn       func(ctx context.Context, residenceID string) ([]*domain.House, error)
}

DataStoreMock is a mock implementation of the datastore interface

func NewDataStoreMock

func NewDataStoreMock() *DataStoreMock

NewDataStoreMock returns a new instance of the mock datastore

func (*DataStoreMock) CreateResidence

func (m *DataStoreMock) CreateResidence(ctx context.Context, payload domain.Residence) (*domain.Residence, error)

CreateResidence mocks the CreateResidence method

func (*DataStoreMock) GetUserPINByUserID

func (m *DataStoreMock) GetUserPINByUserID(ctx context.Context, userID string, flavour enums.Flavour) (*domain.UserPIN, error)

GetUserPINByUserID mocks the GetUserPINByUserID method

func (*DataStoreMock) GetUserProfileByPhoneNumber

func (m *DataStoreMock) GetUserProfileByPhoneNumber(ctx context.Context, phoneNumber string, flavour enums.Flavour) (*domain.User, error)

GetUserProfileByPhoneNumber mocks the GetUserProfileByPhoneNumber method

func (*DataStoreMock) GetUserProfileByUserID

func (m *DataStoreMock) GetUserProfileByUserID(ctx context.Context, userID string) (*domain.User, error)

GetUserProfileByUserID mocks the GetUserProfileByUserID method

func (*DataStoreMock) GetUserResidencesByUserID

func (m *DataStoreMock) GetUserResidencesByUserID(ctx context.Context, userID string) ([]*domain.Residence, error)

GetUserResidencesByUserID mocks the GetUserResidencesByUserID method

func (*DataStoreMock) InvalidatePIN

func (m *DataStoreMock) InvalidatePIN(ctx context.Context, userID string, flavour enums.Flavour) (bool, error)

InvalidatePIN mocks the InvalidatePIN method

func (*DataStoreMock) ListHousesInResidence

func (m *DataStoreMock) ListHousesInResidence(ctx context.Context, residenceID string) ([]*domain.House, error)

ListHousesInResidence mocks the ListHousesInResidence method

func (*DataStoreMock) RegisterUser

func (m *DataStoreMock) RegisterUser(ctx context.Context, user *domain.User, contact *domain.Contact, identifier *domain.Identifier) error

RegisterUser mocks the RegisterUser method

func (*DataStoreMock) SaveOTP

func (m *DataStoreMock) SaveOTP(ctx context.Context, otp *domain.OTP) error

SaveOTP mocks the SaveOTP method

func (*DataStoreMock) SavePIN

func (m *DataStoreMock) SavePIN(ctx context.Context, pinInput *domain.UserPIN) (bool, error)

SavePIN mocks the SavePIN method

func (*DataStoreMock) SearchUser

func (m *DataStoreMock) SearchUser(ctx context.Context, searchTerm string) ([]*domain.User, error)

SearchUser mocks the SearchUser method

func (*DataStoreMock) UpdateUser

func (m *DataStoreMock) UpdateUser(ctx context.Context, user *domain.User, updateData map[string]interface{}) (bool, error)

UpdateUser mocks the UpdateUser method

Jump to

Keyboard shortcuts

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