Documentation ¶
Overview ¶
Package fixture provides test suites to test implementations of the interfaces in the categoriesdb package.
Index ¶
- type AccountAdder
- type AccountRemover
- type AccountRenamer
- type Adder
- type Db
- type Fixture
- func (f *Fixture) CacheAccountAdd(t *testing.T, cache AccountAdder)
- func (f *Fixture) CacheAccountAddError(t *testing.T, cache AccountAdder)
- func (f *Fixture) CacheAccountAddMalformed(t *testing.T, cache AccountAdder)
- func (f *Fixture) CacheAccountRemove(t *testing.T, cache AccountRemover)
- func (f *Fixture) CacheAccountRemoveError(t *testing.T, cache AccountRemover)
- func (f *Fixture) CacheAccountRename(t *testing.T, cache AccountRenamer)
- func (f *Fixture) CacheAccountRenameError(t *testing.T, cache AccountRenamer)
- func (f *Fixture) CacheAccountRenameError2(t *testing.T, cache AccountRenamer)
- func (f *Fixture) CacheAccountRenameMalformed(t *testing.T, cache AccountRenamer)
- func (f *Fixture) CacheAccountRenameSame(t *testing.T, cache AccountRenamer)
- func (f *Fixture) CacheAdd(t *testing.T, cache Adder)
- func (f *Fixture) CacheAddError(t *testing.T, cache Adder)
- func (f *Fixture) CacheGet(t *testing.T, cache categoriesdb.Getter)
- func (f *Fixture) CachePurge(t *testing.T, cache Purger)
- func (f *Fixture) CacheRemove(t *testing.T, cache Remover)
- func (f *Fixture) CacheRemoveError(t *testing.T, cache Remover)
- func (f *Fixture) CacheRename(t *testing.T, cache Renamer)
- func (f *Fixture) CacheRenameError(t *testing.T, cache Renamer)
- func (f *Fixture) CatDetailGoodAdd(t *testing.T)
- func (f *Fixture) CatDetailInvalidate(t *testing.T, cache Invalidater)
- func (f *Fixture) CatDetails(t *testing.T)
- func (f *Fixture) CatDetailsBadAdds(t *testing.T)
- func (f *Fixture) CatDetailsRename(t *testing.T)
- func (f *Fixture) CatDetailsRename2(t *testing.T)
- func (f *Fixture) CatDetailsRenameBad(t *testing.T)
- func (f *Fixture) CatDetailsRenameSame(t *testing.T)
- func (f *Fixture) RemoveCatDetail(t *testing.T)
- func (f *Fixture) RemoveCatDetail2(t *testing.T)
- func (f *Fixture) RemoveCatDetailError(t *testing.T)
- func (f *Fixture) RemoveCatDetailMissing(t *testing.T)
- type Invalidater
- type Purger
- type Remover
- type Renamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAdder ¶
type AccountAdder interface { Invalidater categoriesdb.AccountAdder }
type AccountRemover ¶
type AccountRemover interface { Invalidater categoriesdb.AccountRemover }
type AccountRenamer ¶
type AccountRenamer interface { Invalidater categoriesdb.AccountRenamer }
type Adder ¶
type Adder interface { Invalidater categoriesdb.Adder }
type Db ¶
type Db interface { // Read reads category details from the database and returns them. Read(t db.Transaction) (cds categories.CatDetailStore, err error) // Add adds a new category to the database and returns the updated // category details and the Id of the new category. Add(t db.Transaction, cds categories.CatDetailStore, name string) ( newStore categories.CatDetailStore, newId fin.Cat, err error) // Rename renames a category in the database and returns the updated // category details. Rename( t db.Transaction, cds categories.CatDetailStore, id fin.Cat, name string) ( newStore categories.CatDetailStore, err error) // Remove removes a category from the database and returns the updated // category details. Remove(t db.Transaction, cds categories.CatDetailStore, id fin.Cat) ( newStore categories.CatDetailStore, err error) }
Actual tests must provide an implementation of this Db interface.
type Fixture ¶
type Fixture struct { Store findb.AddAccountRunner Doer db.Doer Db }
Fixture tests implementations of interfaces in the categoriesdb package. Each exported method is one test.
func (*Fixture) CacheAccountAdd ¶
func (f *Fixture) CacheAccountAdd(t *testing.T, cache AccountAdder)
func (*Fixture) CacheAccountAddError ¶
func (f *Fixture) CacheAccountAddError(t *testing.T, cache AccountAdder)
func (*Fixture) CacheAccountAddMalformed ¶
func (f *Fixture) CacheAccountAddMalformed( t *testing.T, cache AccountAdder)
func (*Fixture) CacheAccountRemove ¶
func (f *Fixture) CacheAccountRemove(t *testing.T, cache AccountRemover)
func (*Fixture) CacheAccountRemoveError ¶
func (f *Fixture) CacheAccountRemoveError( t *testing.T, cache AccountRemover)
func (*Fixture) CacheAccountRename ¶
func (f *Fixture) CacheAccountRename(t *testing.T, cache AccountRenamer)
func (*Fixture) CacheAccountRenameError ¶
func (f *Fixture) CacheAccountRenameError( t *testing.T, cache AccountRenamer)
func (*Fixture) CacheAccountRenameError2 ¶
func (f *Fixture) CacheAccountRenameError2( t *testing.T, cache AccountRenamer)
func (*Fixture) CacheAccountRenameMalformed ¶
func (f *Fixture) CacheAccountRenameMalformed( t *testing.T, cache AccountRenamer)
func (*Fixture) CacheAccountRenameSame ¶
func (f *Fixture) CacheAccountRenameSame( t *testing.T, cache AccountRenamer)
func (*Fixture) CatDetailGoodAdd ¶
func (*Fixture) CatDetailInvalidate ¶
func (f *Fixture) CatDetailInvalidate(t *testing.T, cache Invalidater)
func (*Fixture) CatDetails ¶
func (*Fixture) CatDetailsBadAdds ¶
func (*Fixture) CatDetailsRename ¶
func (*Fixture) CatDetailsRename2 ¶
func (*Fixture) CatDetailsRenameBad ¶
func (*Fixture) CatDetailsRenameSame ¶
func (*Fixture) RemoveCatDetail ¶
func (*Fixture) RemoveCatDetail2 ¶
func (*Fixture) RemoveCatDetailError ¶
func (*Fixture) RemoveCatDetailMissing ¶
type Invalidater ¶
type Invalidater interface { categoriesdb.Getter categoriesdb.Invalidater }
type Purger ¶
type Purger interface { categoriesdb.Getter categoriesdb.Purger }
type Remover ¶
type Remover interface { Invalidater categoriesdb.Remover }
type Renamer ¶
type Renamer interface { Invalidater categoriesdb.Renamer }
Click to show internal directories.
Click to hide internal directories.