mocks

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 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 CardRepoMock added in v0.2.0

type CardRepoMock struct {
	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, item domain.Card) error

	// DeleteAllInDeckFunc mocks the DeleteAllInDeck method.
	DeleteAllInDeckFunc func(ctx context.Context, deck domain.Deck) error

	// FilterFunc mocks the Filter method.
	FilterFunc func(ctx context.Context, filterFunc func(domain.Card) bool) ([]domain.Card, error)

	// FilterInDeckFunc mocks the FilterInDeck method.
	FilterInDeckFunc func(ctx context.Context, filterFunc func(domain.Card) bool, deck domain.Deck) ([]domain.Card, error)

	// FindFunc mocks the Find method.
	FindFunc func(ctx context.Context, findFunc func(domain.Card) bool) (*domain.Card, error)

	// FindAllFunc mocks the FindAll method.
	FindAllFunc func(ctx context.Context, word string, translation string) ([]domain.Card, error)

	// FindAllByWordFunc mocks the FindAllByWord method.
	FindAllByWordFunc func(ctx context.Context, word string) ([]domain.Card, error)

	// FindAllByWordInDeckFunc mocks the FindAllByWordInDeck method.
	FindAllByWordInDeckFunc func(ctx context.Context, word string, deck domain.Deck) ([]domain.Card, error)

	// FindAllInDeckFunc mocks the FindAllInDeck method.
	FindAllInDeckFunc func(ctx context.Context, word string, translation string, deck domain.Deck) ([]domain.Card, error)

	// ListAllFunc mocks the ListAll method.
	ListAllFunc func(ctx context.Context) ([]domain.Card, error)

	// ListAllInDeckFunc mocks the ListAllInDeck method.
	ListAllInDeckFunc func(ctx context.Context, deck domain.Deck) ([]domain.Card, error)

	// SaveFunc mocks the Save method.
	SaveFunc func(ctx context.Context, item domain.Card) (*domain.Card, error)
	// contains filtered or unexported fields
}

CardRepoMock is a mock implementation of storage.CardRepo.

func TestSomethingThatUsesCardRepo(t *testing.T) {

	// make and configure a mocked storage.CardRepo
	mockedCardRepo := &CardRepoMock{
		DeleteFunc: func(ctx context.Context, item domain.Card) error {
			panic("mock out the Delete method")
		},
		DeleteAllInDeckFunc: func(ctx context.Context, deck domain.Deck) error {
			panic("mock out the DeleteAllInDeck method")
		},
		FilterFunc: func(ctx context.Context, filterFunc func(domain.Card) bool) ([]domain.Card, error) {
			panic("mock out the Filter method")
		},
		FilterInDeckFunc: func(ctx context.Context, filterFunc func(domain.Card) bool, deck domain.Deck) ([]domain.Card, error) {
			panic("mock out the FilterInDeck method")
		},
		FindFunc: func(ctx context.Context, findFunc func(domain.Card) bool) (*domain.Card, error) {
			panic("mock out the Find method")
		},
		FindAllFunc: func(ctx context.Context, word string, translation string) ([]domain.Card, error) {
			panic("mock out the FindAll method")
		},
		FindAllByWordFunc: func(ctx context.Context, word string) ([]domain.Card, error) {
			panic("mock out the FindAllByWord method")
		},
		FindAllByWordInDeckFunc: func(ctx context.Context, word string, deck domain.Deck) ([]domain.Card, error) {
			panic("mock out the FindAllByWordInDeck method")
		},
		FindAllInDeckFunc: func(ctx context.Context, word string, translation string, deck domain.Deck) ([]domain.Card, error) {
			panic("mock out the FindAllInDeck method")
		},
		ListAllFunc: func(ctx context.Context) ([]domain.Card, error) {
			panic("mock out the ListAll method")
		},
		ListAllInDeckFunc: func(ctx context.Context, deck domain.Deck) ([]domain.Card, error) {
			panic("mock out the ListAllInDeck method")
		},
		SaveFunc: func(ctx context.Context, item domain.Card) (*domain.Card, error) {
			panic("mock out the Save method")
		},
	}

	// use mockedCardRepo in code that requires storage.CardRepo
	// and then make assertions.

}

func (*CardRepoMock) Delete added in v0.2.0

func (mock *CardRepoMock) Delete(ctx context.Context, item domain.Card) error

Delete calls DeleteFunc.

func (*CardRepoMock) DeleteAllInDeck added in v0.2.0

func (mock *CardRepoMock) DeleteAllInDeck(ctx context.Context, deck domain.Deck) error

DeleteAllInDeck calls DeleteAllInDeckFunc.

func (*CardRepoMock) DeleteAllInDeckCalls added in v0.2.0

func (mock *CardRepoMock) DeleteAllInDeckCalls() []struct {
	Ctx  context.Context
	Deck domain.Deck
}

DeleteAllInDeckCalls gets all the calls that were made to DeleteAllInDeck. Check the length with:

len(mockedCardRepo.DeleteAllInDeckCalls())

func (*CardRepoMock) DeleteCalls added in v0.2.0

func (mock *CardRepoMock) DeleteCalls() []struct {
	Ctx  context.Context
	Item domain.Card
}

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

len(mockedCardRepo.DeleteCalls())

func (*CardRepoMock) Filter added in v0.2.0

func (mock *CardRepoMock) Filter(ctx context.Context, filterFunc func(domain.Card) bool) ([]domain.Card, error)

Filter calls FilterFunc.

func (*CardRepoMock) FilterCalls added in v0.2.0

func (mock *CardRepoMock) FilterCalls() []struct {
	Ctx        context.Context
	FilterFunc func(domain.Card) bool
}

FilterCalls gets all the calls that were made to Filter. Check the length with:

len(mockedCardRepo.FilterCalls())

func (*CardRepoMock) FilterInDeck added in v0.2.1

func (mock *CardRepoMock) FilterInDeck(ctx context.Context, filterFunc func(domain.Card) bool, deck domain.Deck) ([]domain.Card, error)

FilterInDeck calls FilterInDeckFunc.

func (*CardRepoMock) FilterInDeckCalls added in v0.2.1

func (mock *CardRepoMock) FilterInDeckCalls() []struct {
	Ctx        context.Context
	FilterFunc func(domain.Card) bool
	Deck       domain.Deck
}

FilterInDeckCalls gets all the calls that were made to FilterInDeck. Check the length with:

len(mockedCardRepo.FilterInDeckCalls())

func (*CardRepoMock) Find added in v0.2.0

func (mock *CardRepoMock) Find(ctx context.Context, findFunc func(domain.Card) bool) (*domain.Card, error)

Find calls FindFunc.

func (*CardRepoMock) FindAll added in v0.2.1

func (mock *CardRepoMock) FindAll(ctx context.Context, word string, translation string) ([]domain.Card, error)

FindAll calls FindAllFunc.

func (*CardRepoMock) FindAllByWord added in v0.2.0

func (mock *CardRepoMock) FindAllByWord(ctx context.Context, word string) ([]domain.Card, error)

FindAllByWord calls FindAllByWordFunc.

func (*CardRepoMock) FindAllByWordCalls added in v0.2.0

func (mock *CardRepoMock) FindAllByWordCalls() []struct {
	Ctx  context.Context
	Word string
}

FindAllByWordCalls gets all the calls that were made to FindAllByWord. Check the length with:

len(mockedCardRepo.FindAllByWordCalls())

func (*CardRepoMock) FindAllByWordInDeck added in v0.2.0

func (mock *CardRepoMock) FindAllByWordInDeck(ctx context.Context, word string, deck domain.Deck) ([]domain.Card, error)

FindAllByWordInDeck calls FindAllByWordInDeckFunc.

func (*CardRepoMock) FindAllByWordInDeckCalls added in v0.2.0

func (mock *CardRepoMock) FindAllByWordInDeckCalls() []struct {
	Ctx  context.Context
	Word string
	Deck domain.Deck
}

FindAllByWordInDeckCalls gets all the calls that were made to FindAllByWordInDeck. Check the length with:

len(mockedCardRepo.FindAllByWordInDeckCalls())

func (*CardRepoMock) FindAllCalls added in v0.2.1

func (mock *CardRepoMock) FindAllCalls() []struct {
	Ctx         context.Context
	Word        string
	Translation string
}

FindAllCalls gets all the calls that were made to FindAll. Check the length with:

len(mockedCardRepo.FindAllCalls())

func (*CardRepoMock) FindAllInDeck added in v0.2.1

func (mock *CardRepoMock) FindAllInDeck(ctx context.Context, word string, translation string, deck domain.Deck) ([]domain.Card, error)

FindAllInDeck calls FindAllInDeckFunc.

func (*CardRepoMock) FindAllInDeckCalls added in v0.2.1

func (mock *CardRepoMock) FindAllInDeckCalls() []struct {
	Ctx         context.Context
	Word        string
	Translation string
	Deck        domain.Deck
}

FindAllInDeckCalls gets all the calls that were made to FindAllInDeck. Check the length with:

len(mockedCardRepo.FindAllInDeckCalls())

func (*CardRepoMock) FindCalls added in v0.2.0

func (mock *CardRepoMock) FindCalls() []struct {
	Ctx      context.Context
	FindFunc func(domain.Card) bool
}

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

len(mockedCardRepo.FindCalls())

func (*CardRepoMock) ListAll added in v0.2.0

func (mock *CardRepoMock) ListAll(ctx context.Context) ([]domain.Card, error)

ListAll calls ListAllFunc.

func (*CardRepoMock) ListAllCalls added in v0.2.0

func (mock *CardRepoMock) ListAllCalls() []struct {
	Ctx context.Context
}

ListAllCalls gets all the calls that were made to ListAll. Check the length with:

len(mockedCardRepo.ListAllCalls())

func (*CardRepoMock) ListAllInDeck added in v0.2.0

func (mock *CardRepoMock) ListAllInDeck(ctx context.Context, deck domain.Deck) ([]domain.Card, error)

ListAllInDeck calls ListAllInDeckFunc.

func (*CardRepoMock) ListAllInDeckCalls added in v0.2.0

func (mock *CardRepoMock) ListAllInDeckCalls() []struct {
	Ctx  context.Context
	Deck domain.Deck
}

ListAllInDeckCalls gets all the calls that were made to ListAllInDeck. Check the length with:

len(mockedCardRepo.ListAllInDeckCalls())

func (*CardRepoMock) Save added in v0.2.0

func (mock *CardRepoMock) Save(ctx context.Context, item domain.Card) (*domain.Card, error)

Save calls SaveFunc.

func (*CardRepoMock) SaveCalls added in v0.2.0

func (mock *CardRepoMock) SaveCalls() []struct {
	Ctx  context.Context
	Item domain.Card
}

SaveCalls gets all the calls that were made to Save. Check the length with:

len(mockedCardRepo.SaveCalls())

type DeckRepoMock

type DeckRepoMock struct {
	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, item domain.Deck) error

	// FilterFunc mocks the Filter method.
	FilterFunc func(ctx context.Context, filterFunc func(domain.Deck) bool) ([]domain.Deck, error)

	// FindFunc mocks the Find method.
	FindFunc func(ctx context.Context, findFunc func(domain.Deck) bool) (*domain.Deck, error)

	// ListAllFunc mocks the ListAll method.
	ListAllFunc func(ctx context.Context) ([]domain.Deck, error)

	// SaveFunc mocks the Save method.
	SaveFunc func(ctx context.Context, item domain.Deck) (*domain.Deck, error)
	// contains filtered or unexported fields
}

DeckRepoMock is a mock implementation of storage.DeckRepo.

func TestSomethingThatUsesDeckRepo(t *testing.T) {

	// make and configure a mocked storage.DeckRepo
	mockedDeckRepo := &DeckRepoMock{
		DeleteFunc: func(ctx context.Context, item domain.Deck) error {
			panic("mock out the Delete method")
		},
		FilterFunc: func(ctx context.Context, filterFunc func(domain.Deck) bool) ([]domain.Deck, error) {
			panic("mock out the Filter method")
		},
		FindFunc: func(ctx context.Context, findFunc func(domain.Deck) bool) (*domain.Deck, error) {
			panic("mock out the Find method")
		},
		ListAllFunc: func(ctx context.Context) ([]domain.Deck, error) {
			panic("mock out the ListAll method")
		},
		SaveFunc: func(ctx context.Context, item domain.Deck) (*domain.Deck, error) {
			panic("mock out the Save method")
		},
	}

	// use mockedDeckRepo in code that requires storage.DeckRepo
	// and then make assertions.

}

func (*DeckRepoMock) Delete

func (mock *DeckRepoMock) Delete(ctx context.Context, item domain.Deck) error

Delete calls DeleteFunc.

func (*DeckRepoMock) DeleteCalls

func (mock *DeckRepoMock) DeleteCalls() []struct {
	Ctx  context.Context
	Item domain.Deck
}

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

len(mockedDeckRepo.DeleteCalls())

func (*DeckRepoMock) Filter

func (mock *DeckRepoMock) Filter(ctx context.Context, filterFunc func(domain.Deck) bool) ([]domain.Deck, error)

Filter calls FilterFunc.

func (*DeckRepoMock) FilterCalls

func (mock *DeckRepoMock) FilterCalls() []struct {
	Ctx        context.Context
	FilterFunc func(domain.Deck) bool
}

FilterCalls gets all the calls that were made to Filter. Check the length with:

len(mockedDeckRepo.FilterCalls())

func (*DeckRepoMock) Find

func (mock *DeckRepoMock) Find(ctx context.Context, findFunc func(domain.Deck) bool) (*domain.Deck, error)

Find calls FindFunc.

func (*DeckRepoMock) FindCalls

func (mock *DeckRepoMock) FindCalls() []struct {
	Ctx      context.Context
	FindFunc func(domain.Deck) bool
}

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

len(mockedDeckRepo.FindCalls())

func (*DeckRepoMock) ListAll

func (mock *DeckRepoMock) ListAll(ctx context.Context) ([]domain.Deck, error)

ListAll calls ListAllFunc.

func (*DeckRepoMock) ListAllCalls

func (mock *DeckRepoMock) ListAllCalls() []struct {
	Ctx context.Context
}

ListAllCalls gets all the calls that were made to ListAll. Check the length with:

len(mockedDeckRepo.ListAllCalls())

func (*DeckRepoMock) Save

func (mock *DeckRepoMock) Save(ctx context.Context, item domain.Deck) (*domain.Deck, error)

Save calls SaveFunc.

func (*DeckRepoMock) SaveCalls

func (mock *DeckRepoMock) SaveCalls() []struct {
	Ctx  context.Context
	Item domain.Deck
}

SaveCalls gets all the calls that were made to Save. Check the length with:

len(mockedDeckRepo.SaveCalls())

type FlashcardServiceMock

type FlashcardServiceMock struct {
	// DeleteAllCardsInDeckFunc mocks the DeleteAllCardsInDeck method.
	DeleteAllCardsInDeckFunc func(deck domain.Deck) error

	// DeleteCardFunc mocks the DeleteCard method.
	DeleteCardFunc func(card domain.Card) error

	// DeleteDeckByNameFunc mocks the DeleteDeckByName method.
	DeleteDeckByNameFunc func(name string) error

	// FilterCardsFunc mocks the FilterCards method.
	FilterCardsFunc func(filterFunc func(domain.Card) bool) ([]domain.Card, error)

	// FilterCardsInDeckFunc mocks the FilterCardsInDeck method.
	FilterCardsInDeckFunc func(filterFunc func(domain.Card) bool, deck domain.Deck) ([]domain.Card, error)

	// FilterDecksFunc mocks the FilterDecks method.
	FilterDecksFunc func(filterFunc func(domain.Deck) bool) ([]domain.Deck, error)

	// FindCardsFunc mocks the FindCards method.
	FindCardsFunc func(word string, translation string) ([]domain.Card, error)

	// FindCardsByWordFunc mocks the FindCardsByWord method.
	FindCardsByWordFunc func(word string) ([]domain.Card, error)

	// FindCardsByWordInDeckFunc mocks the FindCardsByWordInDeck method.
	FindCardsByWordInDeckFunc func(word string, deck domain.Deck) ([]domain.Card, error)

	// FindCardsInDeckFunc mocks the FindCardsInDeck method.
	FindCardsInDeckFunc func(word string, translation string, inDeck domain.Deck) ([]domain.Card, error)

	// FindDeckByNameFunc mocks the FindDeckByName method.
	FindDeckByNameFunc func(name string) (*domain.Deck, error)

	// GetStorageFunc mocks the GetStorage method.
	GetStorageFunc func() *storage.Storage

	// ListAllCardsFunc mocks the ListAllCards method.
	ListAllCardsFunc func(inDeck domain.Deck) ([]domain.Card, error)

	// ListAllDecksFunc mocks the ListAllDecks method.
	ListAllDecksFunc func() ([]domain.Deck, error)

	// PutCardInDeckFunc mocks the PutCardInDeck method.
	PutCardInDeckFunc func(card domain.Card, deck domain.Deck) (*domain.Card, error)

	// SaveCardFunc mocks the SaveCard method.
	SaveCardFunc func(card domain.Card) (*domain.Card, error)

	// SaveDeckFunc mocks the SaveDeck method.
	SaveDeckFunc func(deck domain.Deck) (*domain.Deck, error)
	// contains filtered or unexported fields
}

FlashcardServiceMock is a mock implementation of service.FlashcardService.

func TestSomethingThatUsesFlashcardService(t *testing.T) {

	// make and configure a mocked service.FlashcardService
	mockedFlashcardService := &FlashcardServiceMock{
		DeleteAllCardsInDeckFunc: func(deck domain.Deck) error {
			panic("mock out the DeleteAllCardsInDeck method")
		},
		DeleteCardFunc: func(card domain.Card) error {
			panic("mock out the DeleteCard method")
		},
		DeleteDeckByNameFunc: func(name string) error {
			panic("mock out the DeleteDeckByName method")
		},
		FilterCardsFunc: func(filterFunc func(domain.Card) bool) ([]domain.Card, error) {
			panic("mock out the FilterCards method")
		},
		FilterCardsInDeckFunc: func(filterFunc func(domain.Card) bool, deck domain.Deck) ([]domain.Card, error) {
			panic("mock out the FilterCardsInDeck method")
		},
		FilterDecksFunc: func(filterFunc func(domain.Deck) bool) ([]domain.Deck, error) {
			panic("mock out the FilterDecks method")
		},
		FindCardsFunc: func(word string, translation string) ([]domain.Card, error) {
			panic("mock out the FindCards method")
		},
		FindCardsByWordFunc: func(word string) ([]domain.Card, error) {
			panic("mock out the FindCardsByWord method")
		},
		FindCardsByWordInDeckFunc: func(word string, deck domain.Deck) ([]domain.Card, error) {
			panic("mock out the FindCardsByWordInDeck method")
		},
		FindCardsInDeckFunc: func(word string, translation string, inDeck domain.Deck) ([]domain.Card, error) {
			panic("mock out the FindCardsInDeck method")
		},
		FindDeckByNameFunc: func(name string) (*domain.Deck, error) {
			panic("mock out the FindDeckByName method")
		},
		GetStorageFunc: func() *storage.Storage {
			panic("mock out the GetStorage method")
		},
		ListAllCardsFunc: func(inDeck domain.Deck) ([]domain.Card, error) {
			panic("mock out the ListAllCards method")
		},
		ListAllDecksFunc: func() ([]domain.Deck, error) {
			panic("mock out the ListAllDecks method")
		},
		PutCardInDeckFunc: func(card domain.Card, deck domain.Deck) (*domain.Card, error) {
			panic("mock out the PutCardInDeck method")
		},
		SaveCardFunc: func(card domain.Card) (*domain.Card, error) {
			panic("mock out the SaveCard method")
		},
		SaveDeckFunc: func(deck domain.Deck) (*domain.Deck, error) {
			panic("mock out the SaveDeck method")
		},
	}

	// use mockedFlashcardService in code that requires service.FlashcardService
	// and then make assertions.

}

func (*FlashcardServiceMock) DeleteAllCardsInDeck added in v0.2.0

func (mock *FlashcardServiceMock) DeleteAllCardsInDeck(deck domain.Deck) error

DeleteAllCardsInDeck calls DeleteAllCardsInDeckFunc.

func (*FlashcardServiceMock) DeleteAllCardsInDeckCalls added in v0.2.0

func (mock *FlashcardServiceMock) DeleteAllCardsInDeckCalls() []struct {
	Deck domain.Deck
}

DeleteAllCardsInDeckCalls gets all the calls that were made to DeleteAllCardsInDeck. Check the length with:

len(mockedFlashcardService.DeleteAllCardsInDeckCalls())

func (*FlashcardServiceMock) DeleteCard added in v0.2.0

func (mock *FlashcardServiceMock) DeleteCard(card domain.Card) error

DeleteCard calls DeleteCardFunc.

func (*FlashcardServiceMock) DeleteCardCalls added in v0.2.0

func (mock *FlashcardServiceMock) DeleteCardCalls() []struct {
	Card domain.Card
}

DeleteCardCalls gets all the calls that were made to DeleteCard. Check the length with:

len(mockedFlashcardService.DeleteCardCalls())

func (*FlashcardServiceMock) DeleteDeckByName

func (mock *FlashcardServiceMock) DeleteDeckByName(name string) error

DeleteDeckByName calls DeleteDeckByNameFunc.

func (*FlashcardServiceMock) DeleteDeckByNameCalls

func (mock *FlashcardServiceMock) DeleteDeckByNameCalls() []struct {
	Name string
}

DeleteDeckByNameCalls gets all the calls that were made to DeleteDeckByName. Check the length with:

len(mockedFlashcardService.DeleteDeckByNameCalls())

func (*FlashcardServiceMock) FilterCards added in v0.2.0

func (mock *FlashcardServiceMock) FilterCards(filterFunc func(domain.Card) bool) ([]domain.Card, error)

FilterCards calls FilterCardsFunc.

func (*FlashcardServiceMock) FilterCardsCalls added in v0.2.0

func (mock *FlashcardServiceMock) FilterCardsCalls() []struct {
	FilterFunc func(domain.Card) bool
}

FilterCardsCalls gets all the calls that were made to FilterCards. Check the length with:

len(mockedFlashcardService.FilterCardsCalls())

func (*FlashcardServiceMock) FilterCardsInDeck added in v0.2.1

func (mock *FlashcardServiceMock) FilterCardsInDeck(filterFunc func(domain.Card) bool, deck domain.Deck) ([]domain.Card, error)

FilterCardsInDeck calls FilterCardsInDeckFunc.

func (*FlashcardServiceMock) FilterCardsInDeckCalls added in v0.2.1

func (mock *FlashcardServiceMock) FilterCardsInDeckCalls() []struct {
	FilterFunc func(domain.Card) bool
	Deck       domain.Deck
}

FilterCardsInDeckCalls gets all the calls that were made to FilterCardsInDeck. Check the length with:

len(mockedFlashcardService.FilterCardsInDeckCalls())

func (*FlashcardServiceMock) FilterDecks added in v0.2.0

func (mock *FlashcardServiceMock) FilterDecks(filterFunc func(domain.Deck) bool) ([]domain.Deck, error)

FilterDecks calls FilterDecksFunc.

func (*FlashcardServiceMock) FilterDecksCalls added in v0.2.0

func (mock *FlashcardServiceMock) FilterDecksCalls() []struct {
	FilterFunc func(domain.Deck) bool
}

FilterDecksCalls gets all the calls that were made to FilterDecks. Check the length with:

len(mockedFlashcardService.FilterDecksCalls())

func (*FlashcardServiceMock) FindCards added in v0.2.1

func (mock *FlashcardServiceMock) FindCards(word string, translation string) ([]domain.Card, error)

FindCards calls FindCardsFunc.

func (*FlashcardServiceMock) FindCardsByWord

func (mock *FlashcardServiceMock) FindCardsByWord(word string) ([]domain.Card, error)

FindCardsByWord calls FindCardsByWordFunc.

func (*FlashcardServiceMock) FindCardsByWordCalls

func (mock *FlashcardServiceMock) FindCardsByWordCalls() []struct {
	Word string
}

FindCardsByWordCalls gets all the calls that were made to FindCardsByWord. Check the length with:

len(mockedFlashcardService.FindCardsByWordCalls())

func (*FlashcardServiceMock) FindCardsByWordInDeck added in v0.2.0

func (mock *FlashcardServiceMock) FindCardsByWordInDeck(word string, deck domain.Deck) ([]domain.Card, error)

FindCardsByWordInDeck calls FindCardsByWordInDeckFunc.

func (*FlashcardServiceMock) FindCardsByWordInDeckCalls added in v0.2.0

func (mock *FlashcardServiceMock) FindCardsByWordInDeckCalls() []struct {
	Word string
	Deck domain.Deck
}

FindCardsByWordInDeckCalls gets all the calls that were made to FindCardsByWordInDeck. Check the length with:

len(mockedFlashcardService.FindCardsByWordInDeckCalls())

func (*FlashcardServiceMock) FindCardsCalls added in v0.2.1

func (mock *FlashcardServiceMock) FindCardsCalls() []struct {
	Word        string
	Translation string
}

FindCardsCalls gets all the calls that were made to FindCards. Check the length with:

len(mockedFlashcardService.FindCardsCalls())

func (*FlashcardServiceMock) FindCardsInDeck added in v0.2.1

func (mock *FlashcardServiceMock) FindCardsInDeck(word string, translation string, inDeck domain.Deck) ([]domain.Card, error)

FindCardsInDeck calls FindCardsInDeckFunc.

func (*FlashcardServiceMock) FindCardsInDeckCalls added in v0.2.1

func (mock *FlashcardServiceMock) FindCardsInDeckCalls() []struct {
	Word        string
	Translation string
	InDeck      domain.Deck
}

FindCardsInDeckCalls gets all the calls that were made to FindCardsInDeck. Check the length with:

len(mockedFlashcardService.FindCardsInDeckCalls())

func (*FlashcardServiceMock) FindDeckByName

func (mock *FlashcardServiceMock) FindDeckByName(name string) (*domain.Deck, error)

FindDeckByName calls FindDeckByNameFunc.

func (*FlashcardServiceMock) FindDeckByNameCalls

func (mock *FlashcardServiceMock) FindDeckByNameCalls() []struct {
	Name string
}

FindDeckByNameCalls gets all the calls that were made to FindDeckByName. Check the length with:

len(mockedFlashcardService.FindDeckByNameCalls())

func (*FlashcardServiceMock) GetStorage

func (mock *FlashcardServiceMock) GetStorage() *storage.Storage

GetStorage calls GetStorageFunc.

func (*FlashcardServiceMock) GetStorageCalls

func (mock *FlashcardServiceMock) GetStorageCalls() []struct {
}

GetStorageCalls gets all the calls that were made to GetStorage. Check the length with:

len(mockedFlashcardService.GetStorageCalls())

func (*FlashcardServiceMock) ListAllCards

func (mock *FlashcardServiceMock) ListAllCards(inDeck domain.Deck) ([]domain.Card, error)

ListAllCards calls ListAllCardsFunc.

func (*FlashcardServiceMock) ListAllCardsCalls

func (mock *FlashcardServiceMock) ListAllCardsCalls() []struct {
	InDeck domain.Deck
}

ListAllCardsCalls gets all the calls that were made to ListAllCards. Check the length with:

len(mockedFlashcardService.ListAllCardsCalls())

func (*FlashcardServiceMock) ListAllDecks

func (mock *FlashcardServiceMock) ListAllDecks() ([]domain.Deck, error)

ListAllDecks calls ListAllDecksFunc.

func (*FlashcardServiceMock) ListAllDecksCalls

func (mock *FlashcardServiceMock) ListAllDecksCalls() []struct {
}

ListAllDecksCalls gets all the calls that were made to ListAllDecks. Check the length with:

len(mockedFlashcardService.ListAllDecksCalls())

func (*FlashcardServiceMock) PutCardInDeck added in v0.2.0

func (mock *FlashcardServiceMock) PutCardInDeck(card domain.Card, deck domain.Deck) (*domain.Card, error)

PutCardInDeck calls PutCardInDeckFunc.

func (*FlashcardServiceMock) PutCardInDeckCalls added in v0.2.0

func (mock *FlashcardServiceMock) PutCardInDeckCalls() []struct {
	Card domain.Card
	Deck domain.Deck
}

PutCardInDeckCalls gets all the calls that were made to PutCardInDeck. Check the length with:

len(mockedFlashcardService.PutCardInDeckCalls())

func (*FlashcardServiceMock) SaveCard

func (mock *FlashcardServiceMock) SaveCard(card domain.Card) (*domain.Card, error)

SaveCard calls SaveCardFunc.

func (*FlashcardServiceMock) SaveCardCalls

func (mock *FlashcardServiceMock) SaveCardCalls() []struct {
	Card domain.Card
}

SaveCardCalls gets all the calls that were made to SaveCard. Check the length with:

len(mockedFlashcardService.SaveCardCalls())

func (*FlashcardServiceMock) SaveDeck

func (mock *FlashcardServiceMock) SaveDeck(deck domain.Deck) (*domain.Deck, error)

SaveDeck calls SaveDeckFunc.

func (*FlashcardServiceMock) SaveDeckCalls

func (mock *FlashcardServiceMock) SaveDeckCalls() []struct {
	Deck domain.Deck
}

SaveDeckCalls gets all the calls that were made to SaveDeck. Check the length with:

len(mockedFlashcardService.SaveDeckCalls())

Jump to

Keyboard shortcuts

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