usecasetest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunParallelWithUseCases

func RunParallelWithUseCases(t *testing.T, name string, wsName model.WSName, f func(t *testing.T, ut *UseCases))

func SetUpUseCases

func SetUpUseCases(t *testing.T, dbPath string, wsName model.WSName) (u *interactor.UseCases, closer func(), remover func())

SetUpUseCases setup Usecases instance and cleanup function

Types

type Asset

type Asset struct {
	// contains filtered or unexported fields
}

func (*Asset) AddOrMergeImportAssets

func (a *Asset) AddOrMergeImportAssets(ws model.WSName, assets []*model.ImportAsset)

type AssetRepository

type AssetRepository struct {
	// contains filtered or unexported fields
}

func (*AssetRepository) BatchAdd

func (a *AssetRepository) BatchAdd(ws model.WSName, assets []*model.Asset) []model.AssetID

func (*AssetRepository) List

func (a *AssetRepository) List(ws model.WSName) (assets []*model.Asset)

func (*AssetRepository) ListBy

func (a *AssetRepository) ListBy(ws model.WSName, f func(asset *model.Asset) bool) (assets []*model.Asset)

type Client

type Client struct {
	Asset *AssetRepository
	Tag   *TagRepository
}

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

func (*Tag) List added in v0.1.4

func (t *Tag) List(ws model.WSName) (tags []*model.Tag)

func (*Tag) SetTagByNames added in v0.1.4

func (t *Tag) SetTagByNames(ws model.WSName, tagNames []string) []*model.Tag

SetTagByNames is wrapper for usecase/SetTagByNames.

type TagRepository

type TagRepository struct {
	// contains filtered or unexported fields
}

func (*TagRepository) AddWithIndex added in v0.1.4

func (t *TagRepository) AddWithIndex(ws model.WSName, tagWithIndex *model.UnregisteredTag) *model.Tag

type UseCaseUser

type UseCaseUser struct {
	DBPath string

	RemoveDB func()
	// contains filtered or unexported fields
}

func NewTestUseCaseUser

func NewTestUseCaseUser(t *testing.T, wsName model.WSName) *UseCaseUser

func (*UseCaseUser) Use

func (u *UseCaseUser) Use(f func(u *UseCases))

type UseCases

type UseCases struct {
	Usecases *interactor.UseCases
	Asset    *Asset
	Tag      *Tag
	Client   *Client
}

func NewUseCases

func NewUseCases(t *testing.T, u *interactor.UseCases) *UseCases

func SetUpTestUseCases

func SetUpTestUseCases(t *testing.T, dbPath string, wsName model.WSName) (u *UseCases, closer func(), remover func())

Jump to

Keyboard shortcuts

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