moqs

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRepositoryInterfaceMock

type AuthRepositoryInterfaceMock struct {
	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error
	// contains filtered or unexported fields
}

AuthRepositoryInterfaceMock is a mock implementation of repository.AuthRepositoryInterface.

func TestSomethingThatUsesAuthRepositoryInterface(t *testing.T) {

	// make and configure a mocked repository.AuthRepositoryInterface
	mockedAuthRepositoryInterface := &AuthRepositoryInterfaceMock{
		DeleteFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error {
			panic("mock out the Delete method")
		},
	}

	// use mockedAuthRepositoryInterface in code that requires repository.AuthRepositoryInterface
	// and then make assertions.

}

func (*AuthRepositoryInterfaceMock) Delete

Delete calls DeleteFunc.

func (*AuthRepositoryInterfaceMock) DeleteCalls

func (mock *AuthRepositoryInterfaceMock) DeleteCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	Tx  *firestore.Transaction
	UID string
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedAuthRepositoryInterface.DeleteCalls())

type CommonRepositoryInterfaceMock

type CommonRepositoryInterfaceMock struct {
	// CommitFunc mocks the Commit method.
	CommitFunc func(ctx context.Context, batch *firestore.BulkWriter)
	// contains filtered or unexported fields
}

CommonRepositoryInterfaceMock is a mock implementation of repository.CommonRepositoryInterface.

func TestSomethingThatUsesCommonRepositoryInterface(t *testing.T) {

	// make and configure a mocked repository.CommonRepositoryInterface
	mockedCommonRepositoryInterface := &CommonRepositoryInterfaceMock{
		CommitFunc: func(ctx context.Context, batch *firestore.BulkWriter)  {
			panic("mock out the Commit method")
		},
	}

	// use mockedCommonRepositoryInterface in code that requires repository.CommonRepositoryInterface
	// and then make assertions.

}

func (*CommonRepositoryInterfaceMock) Commit

Commit calls CommitFunc.

func (*CommonRepositoryInterfaceMock) CommitCalls

func (mock *CommonRepositoryInterfaceMock) CommitCalls() []struct {
	Ctx   context.Context
	Batch *firestore.BulkWriter
}

CommitCalls gets all the calls that were made to Commit. Check the length with:

len(mockedCommonRepositoryInterface.CommitCalls())

type InviteRepositoryInterfaceMock

type InviteRepositoryInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Invite) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, code string) error

	// DeleteByUserIDFunc mocks the DeleteByUserID method.
	DeleteByUserIDFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error

	// FindFunc mocks the Find method.
	FindFunc func(ctx context.Context, f *firestore.Client, code string) (*model.Invite, error)

	// FindByUserIDFunc mocks the FindByUserID method.
	FindByUserIDFunc func(ctx context.Context, f *firestore.Client, userID string) (*model.Invite, error)
	// contains filtered or unexported fields
}

InviteRepositoryInterfaceMock is a mock implementation of repository.InviteRepositoryInterface.

func TestSomethingThatUsesInviteRepositoryInterface(t *testing.T) {

	// make and configure a mocked repository.InviteRepositoryInterface
	mockedInviteRepositoryInterface := &InviteRepositoryInterfaceMock{
		CreateFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Invite) error {
			panic("mock out the Create method")
		},
		DeleteFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, code string) error {
			panic("mock out the Delete method")
		},
		DeleteByUserIDFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error {
			panic("mock out the DeleteByUserID method")
		},
		FindFunc: func(ctx context.Context, f *firestore.Client, code string) (*model.Invite, error) {
			panic("mock out the Find method")
		},
		FindByUserIDFunc: func(ctx context.Context, f *firestore.Client, userID string) (*model.Invite, error) {
			panic("mock out the FindByUserID method")
		},
	}

	// use mockedInviteRepositoryInterface in code that requires repository.InviteRepositoryInterface
	// and then make assertions.

}

func (*InviteRepositoryInterfaceMock) Create

Create calls CreateFunc.

func (*InviteRepositoryInterfaceMock) CreateCalls

func (mock *InviteRepositoryInterfaceMock) CreateCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	Tx  *firestore.Transaction
	I   *model.Invite
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedInviteRepositoryInterface.CreateCalls())

func (*InviteRepositoryInterfaceMock) Delete

Delete calls DeleteFunc.

func (*InviteRepositoryInterfaceMock) DeleteByUserID

func (mock *InviteRepositoryInterfaceMock) DeleteByUserID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error

DeleteByUserID calls DeleteByUserIDFunc.

func (*InviteRepositoryInterfaceMock) DeleteByUserIDCalls

func (mock *InviteRepositoryInterfaceMock) DeleteByUserIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	Tx     *firestore.Transaction
	UserID string
}

DeleteByUserIDCalls gets all the calls that were made to DeleteByUserID. Check the length with:

len(mockedInviteRepositoryInterface.DeleteByUserIDCalls())

func (*InviteRepositoryInterfaceMock) DeleteCalls

func (mock *InviteRepositoryInterfaceMock) DeleteCalls() []struct {
	Ctx  context.Context
	F    *firestore.Client
	Tx   *firestore.Transaction
	Code string
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedInviteRepositoryInterface.DeleteCalls())

func (*InviteRepositoryInterfaceMock) Find

Find calls FindFunc.

func (*InviteRepositoryInterfaceMock) FindByUserID

func (mock *InviteRepositoryInterfaceMock) FindByUserID(ctx context.Context, f *firestore.Client, userID string) (*model.Invite, error)

FindByUserID calls FindByUserIDFunc.

func (*InviteRepositoryInterfaceMock) FindByUserIDCalls

func (mock *InviteRepositoryInterfaceMock) FindByUserIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
}

FindByUserIDCalls gets all the calls that were made to FindByUserID. Check the length with:

len(mockedInviteRepositoryInterface.FindByUserIDCalls())

func (*InviteRepositoryInterfaceMock) FindCalls

func (mock *InviteRepositoryInterfaceMock) FindCalls() []struct {
	Ctx  context.Context
	F    *firestore.Client
	Code string
}

FindCalls gets all the calls that were made to Find. Check the length with:

len(mockedInviteRepositoryInterface.FindCalls())

type ItemRepositoryInterfaceMock

type ItemRepositoryInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, f *firestore.Client, userID string, i *model.Item) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, f *firestore.Client, userID string, i *model.DeleteItem) error

	// GetCountUserMultipleInPeriodFunc mocks the GetCountUserMultipleInPeriod method.
	GetCountUserMultipleInPeriodFunc func(ctx context.Context, f *firestore.Client, sip repository.SearchItemParam) (int, error)

	// GetItemFunc mocks the GetItem method.
	GetItemFunc func(ctx context.Context, f *firestore.Client, userID string, id string) (*model.Item, error)

	// GetItemUserMultipleInPeriodFunc mocks the GetItemUserMultipleInPeriod method.
	GetItemUserMultipleInPeriodFunc func(ctx context.Context, f *firestore.Client, sip repository.SearchItemParam, first int, cursor repository.ItemsInPeriodCursor) ([]*model.Item, error)

	// GetItemsInDateFunc mocks the GetItemsInDate method.
	GetItemsInDateFunc func(ctx context.Context, f *firestore.Client, userID string, date time.Time) ([]*model.Item, error)

	// GetItemsInPeriodFunc mocks the GetItemsInPeriod method.
	GetItemsInPeriodFunc func(ctx context.Context, f *firestore.Client, userID string, stertDate time.Time, endDate time.Time, first int, cursor repository.ItemsInPeriodCursor) ([]*model.Item, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, f *firestore.Client, userID string, i *model.UpdateItem, updatedAt time.Time) error
	// contains filtered or unexported fields
}

ItemRepositoryInterfaceMock is a mock implementation of repository.ItemRepositoryInterface.

func TestSomethingThatUsesItemRepositoryInterface(t *testing.T) {

	// make and configure a mocked repository.ItemRepositoryInterface
	mockedItemRepositoryInterface := &ItemRepositoryInterfaceMock{
		CreateFunc: func(ctx context.Context, f *firestore.Client, userID string, i *model.Item) error {
			panic("mock out the Create method")
		},
		DeleteFunc: func(ctx context.Context, f *firestore.Client, userID string, i *model.DeleteItem) error {
			panic("mock out the Delete method")
		},
		GetCountUserMultipleInPeriodFunc: func(ctx context.Context, f *firestore.Client, sip repository.SearchItemParam) (int, error) {
			panic("mock out the GetCountUserMultipleInPeriod method")
		},
		GetItemFunc: func(ctx context.Context, f *firestore.Client, userID string, id string) (*model.Item, error) {
			panic("mock out the GetItem method")
		},
		GetItemUserMultipleInPeriodFunc: func(ctx context.Context, f *firestore.Client, sip repository.SearchItemParam, first int, cursor repository.ItemsInPeriodCursor) ([]*model.Item, error) {
			panic("mock out the GetItemUserMultipleInPeriod method")
		},
		GetItemsInDateFunc: func(ctx context.Context, f *firestore.Client, userID string, date time.Time) ([]*model.Item, error) {
			panic("mock out the GetItemsInDate method")
		},
		GetItemsInPeriodFunc: func(ctx context.Context, f *firestore.Client, userID string, stertDate time.Time, endDate time.Time, first int, cursor repository.ItemsInPeriodCursor) ([]*model.Item, error) {
			panic("mock out the GetItemsInPeriod method")
		},
		UpdateFunc: func(ctx context.Context, f *firestore.Client, userID string, i *model.UpdateItem, updatedAt time.Time) error {
			panic("mock out the Update method")
		},
	}

	// use mockedItemRepositoryInterface in code that requires repository.ItemRepositoryInterface
	// and then make assertions.

}

func (*ItemRepositoryInterfaceMock) Create

func (mock *ItemRepositoryInterfaceMock) Create(ctx context.Context, f *firestore.Client, userID string, i *model.Item) error

Create calls CreateFunc.

func (*ItemRepositoryInterfaceMock) CreateCalls

func (mock *ItemRepositoryInterfaceMock) CreateCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	I      *model.Item
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedItemRepositoryInterface.CreateCalls())

func (*ItemRepositoryInterfaceMock) Delete

Delete calls DeleteFunc.

func (*ItemRepositoryInterfaceMock) DeleteCalls

func (mock *ItemRepositoryInterfaceMock) DeleteCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	I      *model.DeleteItem
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedItemRepositoryInterface.DeleteCalls())

func (*ItemRepositoryInterfaceMock) GetCountUserMultipleInPeriod added in v1.7.0

func (mock *ItemRepositoryInterfaceMock) GetCountUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip repository.SearchItemParam) (int, error)

GetCountUserMultipleInPeriod calls GetCountUserMultipleInPeriodFunc.

func (*ItemRepositoryInterfaceMock) GetCountUserMultipleInPeriodCalls added in v1.7.0

func (mock *ItemRepositoryInterfaceMock) GetCountUserMultipleInPeriodCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	Sip repository.SearchItemParam
}

GetCountUserMultipleInPeriodCalls gets all the calls that were made to GetCountUserMultipleInPeriod. Check the length with:

len(mockedItemRepositoryInterface.GetCountUserMultipleInPeriodCalls())

func (*ItemRepositoryInterfaceMock) GetItem

func (mock *ItemRepositoryInterfaceMock) GetItem(ctx context.Context, f *firestore.Client, userID string, id string) (*model.Item, error)

GetItem calls GetItemFunc.

func (*ItemRepositoryInterfaceMock) GetItemCalls

func (mock *ItemRepositoryInterfaceMock) GetItemCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	ID     string
}

GetItemCalls gets all the calls that were made to GetItem. Check the length with:

len(mockedItemRepositoryInterface.GetItemCalls())

func (*ItemRepositoryInterfaceMock) GetItemUserMultipleInPeriod

func (mock *ItemRepositoryInterfaceMock) GetItemUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip repository.SearchItemParam, first int, cursor repository.ItemsInPeriodCursor) ([]*model.Item, error)

GetItemUserMultipleInPeriod calls GetItemUserMultipleInPeriodFunc.

func (*ItemRepositoryInterfaceMock) GetItemUserMultipleInPeriodCalls

func (mock *ItemRepositoryInterfaceMock) GetItemUserMultipleInPeriodCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	Sip    repository.SearchItemParam
	First  int
	Cursor repository.ItemsInPeriodCursor
}

GetItemUserMultipleInPeriodCalls gets all the calls that were made to GetItemUserMultipleInPeriod. Check the length with:

len(mockedItemRepositoryInterface.GetItemUserMultipleInPeriodCalls())

func (*ItemRepositoryInterfaceMock) GetItemsInDate

func (mock *ItemRepositoryInterfaceMock) GetItemsInDate(ctx context.Context, f *firestore.Client, userID string, date time.Time) ([]*model.Item, error)

GetItemsInDate calls GetItemsInDateFunc.

func (*ItemRepositoryInterfaceMock) GetItemsInDateCalls

func (mock *ItemRepositoryInterfaceMock) GetItemsInDateCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	Date   time.Time
}

GetItemsInDateCalls gets all the calls that were made to GetItemsInDate. Check the length with:

len(mockedItemRepositoryInterface.GetItemsInDateCalls())

func (*ItemRepositoryInterfaceMock) GetItemsInPeriod

func (mock *ItemRepositoryInterfaceMock) GetItemsInPeriod(ctx context.Context, f *firestore.Client, userID string, stertDate time.Time, endDate time.Time, first int, cursor repository.ItemsInPeriodCursor) ([]*model.Item, error)

GetItemsInPeriod calls GetItemsInPeriodFunc.

func (*ItemRepositoryInterfaceMock) GetItemsInPeriodCalls

func (mock *ItemRepositoryInterfaceMock) GetItemsInPeriodCalls() []struct {
	Ctx       context.Context
	F         *firestore.Client
	UserID    string
	StertDate time.Time
	EndDate   time.Time
	First     int
	Cursor    repository.ItemsInPeriodCursor
}

GetItemsInPeriodCalls gets all the calls that were made to GetItemsInPeriod. Check the length with:

len(mockedItemRepositoryInterface.GetItemsInPeriodCalls())

func (*ItemRepositoryInterfaceMock) Update

func (mock *ItemRepositoryInterfaceMock) Update(ctx context.Context, f *firestore.Client, userID string, i *model.UpdateItem, updatedAt time.Time) error

Update calls UpdateFunc.

func (*ItemRepositoryInterfaceMock) UpdateCalls

func (mock *ItemRepositoryInterfaceMock) UpdateCalls() []struct {
	Ctx       context.Context
	F         *firestore.Client
	UserID    string
	I         *model.UpdateItem
	UpdatedAt time.Time
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedItemRepositoryInterface.UpdateCalls())

type PushTokenRepositoryInterfaceMock

type PushTokenRepositoryInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, f *firestore.Client, userID string, i *model.PushToken) error

	// GetItemsFunc mocks the GetItems method.
	GetItemsFunc func(ctx context.Context, f *firestore.Client, userID string) ([]*model.PushToken, error)

	// GetTokensFunc mocks the GetTokens method.
	GetTokensFunc func(ctx context.Context, f *firestore.Client, userID string) []string
	// contains filtered or unexported fields
}

PushTokenRepositoryInterfaceMock is a mock implementation of repository.PushTokenRepositoryInterface.

func TestSomethingThatUsesPushTokenRepositoryInterface(t *testing.T) {

	// make and configure a mocked repository.PushTokenRepositoryInterface
	mockedPushTokenRepositoryInterface := &PushTokenRepositoryInterfaceMock{
		CreateFunc: func(ctx context.Context, f *firestore.Client, userID string, i *model.PushToken) error {
			panic("mock out the Create method")
		},
		GetItemsFunc: func(ctx context.Context, f *firestore.Client, userID string) ([]*model.PushToken, error) {
			panic("mock out the GetItems method")
		},
		GetTokensFunc: func(ctx context.Context, f *firestore.Client, userID string) []string {
			panic("mock out the GetTokens method")
		},
	}

	// use mockedPushTokenRepositoryInterface in code that requires repository.PushTokenRepositoryInterface
	// and then make assertions.

}

func (*PushTokenRepositoryInterfaceMock) Create

Create calls CreateFunc.

func (*PushTokenRepositoryInterfaceMock) CreateCalls

func (mock *PushTokenRepositoryInterfaceMock) CreateCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	I      *model.PushToken
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedPushTokenRepositoryInterface.CreateCalls())

func (*PushTokenRepositoryInterfaceMock) GetItems

GetItems calls GetItemsFunc.

func (*PushTokenRepositoryInterfaceMock) GetItemsCalls

func (mock *PushTokenRepositoryInterfaceMock) GetItemsCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
}

GetItemsCalls gets all the calls that were made to GetItems. Check the length with:

len(mockedPushTokenRepositoryInterface.GetItemsCalls())

func (*PushTokenRepositoryInterfaceMock) GetTokens

func (mock *PushTokenRepositoryInterfaceMock) GetTokens(ctx context.Context, f *firestore.Client, userID string) []string

GetTokens calls GetTokensFunc.

func (*PushTokenRepositoryInterfaceMock) GetTokensCalls

func (mock *PushTokenRepositoryInterfaceMock) GetTokensCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
}

GetTokensCalls gets all the calls that were made to GetTokens. Check the length with:

len(mockedPushTokenRepositoryInterface.GetTokensCalls())

type RelationshipInterfaceMock

type RelationshipInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error

	// ExistByFollowedIDFunc mocks the ExistByFollowedID method.
	ExistByFollowedIDFunc func(ctx context.Context, f *firestore.Client, userID string) (bool, error)

	// FindByFollowedIDFunc mocks the FindByFollowedID method.
	FindByFollowedIDFunc func(ctx context.Context, f *firestore.Client, userID string, first int, cursor repository.RelationshipCursor) ([]*model.Relationship, error)
	// contains filtered or unexported fields
}

RelationshipInterfaceMock is a mock implementation of repository.RelationshipInterface.

func TestSomethingThatUsesRelationshipInterface(t *testing.T) {

	// make and configure a mocked repository.RelationshipInterface
	mockedRelationshipInterface := &RelationshipInterfaceMock{
		CreateFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error {
			panic("mock out the Create method")
		},
		DeleteFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error {
			panic("mock out the Delete method")
		},
		ExistByFollowedIDFunc: func(ctx context.Context, f *firestore.Client, userID string) (bool, error) {
			panic("mock out the ExistByFollowedID method")
		},
		FindByFollowedIDFunc: func(ctx context.Context, f *firestore.Client, userID string, first int, cursor repository.RelationshipCursor) ([]*model.Relationship, error) {
			panic("mock out the FindByFollowedID method")
		},
	}

	// use mockedRelationshipInterface in code that requires repository.RelationshipInterface
	// and then make assertions.

}

func (*RelationshipInterfaceMock) Create

Create calls CreateFunc.

func (*RelationshipInterfaceMock) CreateCalls

func (mock *RelationshipInterfaceMock) CreateCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	Tx  *firestore.Transaction
	I   *model.Relationship
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedRelationshipInterface.CreateCalls())

func (*RelationshipInterfaceMock) Delete

Delete calls DeleteFunc.

func (*RelationshipInterfaceMock) DeleteCalls

func (mock *RelationshipInterfaceMock) DeleteCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	Tx  *firestore.Transaction
	I   *model.Relationship
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedRelationshipInterface.DeleteCalls())

func (*RelationshipInterfaceMock) ExistByFollowedID

func (mock *RelationshipInterfaceMock) ExistByFollowedID(ctx context.Context, f *firestore.Client, userID string) (bool, error)

ExistByFollowedID calls ExistByFollowedIDFunc.

func (*RelationshipInterfaceMock) ExistByFollowedIDCalls

func (mock *RelationshipInterfaceMock) ExistByFollowedIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
}

ExistByFollowedIDCalls gets all the calls that were made to ExistByFollowedID. Check the length with:

len(mockedRelationshipInterface.ExistByFollowedIDCalls())

func (*RelationshipInterfaceMock) FindByFollowedID

func (mock *RelationshipInterfaceMock) FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, cursor repository.RelationshipCursor) ([]*model.Relationship, error)

FindByFollowedID calls FindByFollowedIDFunc.

func (*RelationshipInterfaceMock) FindByFollowedIDCalls

func (mock *RelationshipInterfaceMock) FindByFollowedIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	First  int
	Cursor repository.RelationshipCursor
}

FindByFollowedIDCalls gets all the calls that were made to FindByFollowedID. Check the length with:

len(mockedRelationshipInterface.FindByFollowedIDCalls())

type RelationshipRequestInterfaceMock

type RelationshipRequestInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) error

	// DeleteByFollowedIDFunc mocks the DeleteByFollowedID method.
	DeleteByFollowedIDFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error

	// DeleteByFollowerIDFunc mocks the DeleteByFollowerID method.
	DeleteByFollowerIDFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error

	// FindFunc mocks the Find method.
	FindFunc func(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) (*model.RelationshipRequest, error)

	// FindByFollowedIDFunc mocks the FindByFollowedID method.
	FindByFollowedIDFunc func(ctx context.Context, f *firestore.Client, userID string, first int, cursor repository.RelationshipRequestCursor) ([]*model.RelationshipRequest, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.RelationshipRequest) error
	// contains filtered or unexported fields
}

RelationshipRequestInterfaceMock is a mock implementation of repository.RelationshipRequestInterface.

func TestSomethingThatUsesRelationshipRequestInterface(t *testing.T) {

	// make and configure a mocked repository.RelationshipRequestInterface
	mockedRelationshipRequestInterface := &RelationshipRequestInterfaceMock{
		CreateFunc: func(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) error {
			panic("mock out the Create method")
		},
		DeleteByFollowedIDFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error {
			panic("mock out the DeleteByFollowedID method")
		},
		DeleteByFollowerIDFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error {
			panic("mock out the DeleteByFollowerID method")
		},
		FindFunc: func(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) (*model.RelationshipRequest, error) {
			panic("mock out the Find method")
		},
		FindByFollowedIDFunc: func(ctx context.Context, f *firestore.Client, userID string, first int, cursor repository.RelationshipRequestCursor) ([]*model.RelationshipRequest, error) {
			panic("mock out the FindByFollowedID method")
		},
		UpdateFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.RelationshipRequest) error {
			panic("mock out the Update method")
		},
	}

	// use mockedRelationshipRequestInterface in code that requires repository.RelationshipRequestInterface
	// and then make assertions.

}

func (*RelationshipRequestInterfaceMock) Create

Create calls CreateFunc.

func (*RelationshipRequestInterfaceMock) CreateCalls

func (mock *RelationshipRequestInterfaceMock) CreateCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	I   *model.RelationshipRequest
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedRelationshipRequestInterface.CreateCalls())

func (*RelationshipRequestInterfaceMock) DeleteByFollowedID

func (mock *RelationshipRequestInterfaceMock) DeleteByFollowedID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error

DeleteByFollowedID calls DeleteByFollowedIDFunc.

func (*RelationshipRequestInterfaceMock) DeleteByFollowedIDCalls

func (mock *RelationshipRequestInterfaceMock) DeleteByFollowedIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	Tx     *firestore.Transaction
	UserID string
}

DeleteByFollowedIDCalls gets all the calls that were made to DeleteByFollowedID. Check the length with:

len(mockedRelationshipRequestInterface.DeleteByFollowedIDCalls())

func (*RelationshipRequestInterfaceMock) DeleteByFollowerID

func (mock *RelationshipRequestInterfaceMock) DeleteByFollowerID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error

DeleteByFollowerID calls DeleteByFollowerIDFunc.

func (*RelationshipRequestInterfaceMock) DeleteByFollowerIDCalls

func (mock *RelationshipRequestInterfaceMock) DeleteByFollowerIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	Tx     *firestore.Transaction
	UserID string
}

DeleteByFollowerIDCalls gets all the calls that were made to DeleteByFollowerID. Check the length with:

len(mockedRelationshipRequestInterface.DeleteByFollowerIDCalls())

func (*RelationshipRequestInterfaceMock) Find

Find calls FindFunc.

func (*RelationshipRequestInterfaceMock) FindByFollowedID

FindByFollowedID calls FindByFollowedIDFunc.

func (*RelationshipRequestInterfaceMock) FindByFollowedIDCalls

func (mock *RelationshipRequestInterfaceMock) FindByFollowedIDCalls() []struct {
	Ctx    context.Context
	F      *firestore.Client
	UserID string
	First  int
	Cursor repository.RelationshipRequestCursor
}

FindByFollowedIDCalls gets all the calls that were made to FindByFollowedID. Check the length with:

len(mockedRelationshipRequestInterface.FindByFollowedIDCalls())

func (*RelationshipRequestInterfaceMock) FindCalls

FindCalls gets all the calls that were made to Find. Check the length with:

len(mockedRelationshipRequestInterface.FindCalls())

func (*RelationshipRequestInterfaceMock) Update

Update calls UpdateFunc.

func (*RelationshipRequestInterfaceMock) UpdateCalls

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedRelationshipRequestInterface.UpdateCalls())

type UserRepositoryInterfaceMock

type UserRepositoryInterfaceMock struct {
	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, f *firestore.Client, u *model.User) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error

	// ExistByFirebaseUIDFunc mocks the ExistByFirebaseUID method.
	ExistByFirebaseUIDFunc func(ctx context.Context, f *firestore.Client, fUID string) (bool, error)

	// FindByFirebaseUIDFunc mocks the FindByFirebaseUID method.
	FindByFirebaseUIDFunc func(ctx context.Context, f *firestore.Client, fUID string) (*model.User, error)

	// FindByUIDFunc mocks the FindByUID method.
	FindByUIDFunc func(ctx context.Context, f *firestore.Client, uid string) (*model.User, error)

	// FindDatabaseDataByUIDFunc mocks the FindDatabaseDataByUID method.
	FindDatabaseDataByUIDFunc func(ctx context.Context, f *firestore.Client, uid string) (*repository.User, error)

	// FindInUIDFunc mocks the FindInUID method.
	FindInUIDFunc func(ctx context.Context, f *firestore.Client, uid []string) ([]*model.User, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, f *firestore.Client, u *model.User) error

	// UpdateFirebaseUIDFunc mocks the UpdateFirebaseUID method.
	UpdateFirebaseUIDFunc func(ctx context.Context, f *firestore.Client, user *repository.User) error
	// contains filtered or unexported fields
}

UserRepositoryInterfaceMock is a mock implementation of repository.UserRepositoryInterface.

func TestSomethingThatUsesUserRepositoryInterface(t *testing.T) {

	// make and configure a mocked repository.UserRepositoryInterface
	mockedUserRepositoryInterface := &UserRepositoryInterfaceMock{
		CreateFunc: func(ctx context.Context, f *firestore.Client, u *model.User) error {
			panic("mock out the Create method")
		},
		DeleteFunc: func(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error {
			panic("mock out the Delete method")
		},
		ExistByFirebaseUIDFunc: func(ctx context.Context, f *firestore.Client, fUID string) (bool, error) {
			panic("mock out the ExistByFirebaseUID method")
		},
		FindByFirebaseUIDFunc: func(ctx context.Context, f *firestore.Client, fUID string) (*model.User, error) {
			panic("mock out the FindByFirebaseUID method")
		},
		FindByUIDFunc: func(ctx context.Context, f *firestore.Client, uid string) (*model.User, error) {
			panic("mock out the FindByUID method")
		},
		FindDatabaseDataByUIDFunc: func(ctx context.Context, f *firestore.Client, uid string) (*repository.User, error) {
			panic("mock out the FindDatabaseDataByUID method")
		},
		FindInUIDFunc: func(ctx context.Context, f *firestore.Client, uid []string) ([]*model.User, error) {
			panic("mock out the FindInUID method")
		},
		UpdateFunc: func(ctx context.Context, f *firestore.Client, u *model.User) error {
			panic("mock out the Update method")
		},
		UpdateFirebaseUIDFunc: func(ctx context.Context, f *firestore.Client, user *repository.User) error {
			panic("mock out the UpdateFirebaseUID method")
		},
	}

	// use mockedUserRepositoryInterface in code that requires repository.UserRepositoryInterface
	// and then make assertions.

}

func (*UserRepositoryInterfaceMock) Create

Create calls CreateFunc.

func (*UserRepositoryInterfaceMock) CreateCalls

func (mock *UserRepositoryInterfaceMock) CreateCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	U   *model.User
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedUserRepositoryInterface.CreateCalls())

func (*UserRepositoryInterfaceMock) Delete

Delete calls DeleteFunc.

func (*UserRepositoryInterfaceMock) DeleteCalls

func (mock *UserRepositoryInterfaceMock) DeleteCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	Tx  *firestore.Transaction
	UID string
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedUserRepositoryInterface.DeleteCalls())

func (*UserRepositoryInterfaceMock) ExistByFirebaseUID

func (mock *UserRepositoryInterfaceMock) ExistByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (bool, error)

ExistByFirebaseUID calls ExistByFirebaseUIDFunc.

func (*UserRepositoryInterfaceMock) ExistByFirebaseUIDCalls

func (mock *UserRepositoryInterfaceMock) ExistByFirebaseUIDCalls() []struct {
	Ctx  context.Context
	F    *firestore.Client
	FUID string
}

ExistByFirebaseUIDCalls gets all the calls that were made to ExistByFirebaseUID. Check the length with:

len(mockedUserRepositoryInterface.ExistByFirebaseUIDCalls())

func (*UserRepositoryInterfaceMock) FindByFirebaseUID

func (mock *UserRepositoryInterfaceMock) FindByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (*model.User, error)

FindByFirebaseUID calls FindByFirebaseUIDFunc.

func (*UserRepositoryInterfaceMock) FindByFirebaseUIDCalls

func (mock *UserRepositoryInterfaceMock) FindByFirebaseUIDCalls() []struct {
	Ctx  context.Context
	F    *firestore.Client
	FUID string
}

FindByFirebaseUIDCalls gets all the calls that were made to FindByFirebaseUID. Check the length with:

len(mockedUserRepositoryInterface.FindByFirebaseUIDCalls())

func (*UserRepositoryInterfaceMock) FindByUID

func (mock *UserRepositoryInterfaceMock) FindByUID(ctx context.Context, f *firestore.Client, uid string) (*model.User, error)

FindByUID calls FindByUIDFunc.

func (*UserRepositoryInterfaceMock) FindByUIDCalls

func (mock *UserRepositoryInterfaceMock) FindByUIDCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	UID string
}

FindByUIDCalls gets all the calls that were made to FindByUID. Check the length with:

len(mockedUserRepositoryInterface.FindByUIDCalls())

func (*UserRepositoryInterfaceMock) FindDatabaseDataByUID

func (mock *UserRepositoryInterfaceMock) FindDatabaseDataByUID(ctx context.Context, f *firestore.Client, uid string) (*repository.User, error)

FindDatabaseDataByUID calls FindDatabaseDataByUIDFunc.

func (*UserRepositoryInterfaceMock) FindDatabaseDataByUIDCalls

func (mock *UserRepositoryInterfaceMock) FindDatabaseDataByUIDCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	UID string
}

FindDatabaseDataByUIDCalls gets all the calls that were made to FindDatabaseDataByUID. Check the length with:

len(mockedUserRepositoryInterface.FindDatabaseDataByUIDCalls())

func (*UserRepositoryInterfaceMock) FindInUID

func (mock *UserRepositoryInterfaceMock) FindInUID(ctx context.Context, f *firestore.Client, uid []string) ([]*model.User, error)

FindInUID calls FindInUIDFunc.

func (*UserRepositoryInterfaceMock) FindInUIDCalls

func (mock *UserRepositoryInterfaceMock) FindInUIDCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	UID []string
}

FindInUIDCalls gets all the calls that were made to FindInUID. Check the length with:

len(mockedUserRepositoryInterface.FindInUIDCalls())

func (*UserRepositoryInterfaceMock) Update

Update calls UpdateFunc.

func (*UserRepositoryInterfaceMock) UpdateCalls

func (mock *UserRepositoryInterfaceMock) UpdateCalls() []struct {
	Ctx context.Context
	F   *firestore.Client
	U   *model.User
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedUserRepositoryInterface.UpdateCalls())

func (*UserRepositoryInterfaceMock) UpdateFirebaseUID

func (mock *UserRepositoryInterfaceMock) UpdateFirebaseUID(ctx context.Context, f *firestore.Client, user *repository.User) error

UpdateFirebaseUID calls UpdateFirebaseUIDFunc.

func (*UserRepositoryInterfaceMock) UpdateFirebaseUIDCalls

func (mock *UserRepositoryInterfaceMock) UpdateFirebaseUIDCalls() []struct {
	Ctx  context.Context
	F    *firestore.Client
	User *repository.User
}

UpdateFirebaseUIDCalls gets all the calls that were made to UpdateFirebaseUID. Check the length with:

len(mockedUserRepositoryInterface.UpdateFirebaseUIDCalls())

Jump to

Keyboard shortcuts

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