fixture

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package fixture provides test suites to test implementations of the interfaces in the categoriesdb package.

Index

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) CacheAdd

func (f *Fixture) CacheAdd(t *testing.T, cache Adder)

func (*Fixture) CacheAddError

func (f *Fixture) CacheAddError(t *testing.T, cache Adder)

func (*Fixture) CacheGet

func (f *Fixture) CacheGet(t *testing.T, cache categoriesdb.Getter)

func (*Fixture) CachePurge

func (f *Fixture) CachePurge(t *testing.T, cache Purger)

func (*Fixture) CacheRemove

func (f *Fixture) CacheRemove(t *testing.T, cache Remover)

func (*Fixture) CacheRemoveError

func (f *Fixture) CacheRemoveError(t *testing.T, cache Remover)

func (*Fixture) CacheRename

func (f *Fixture) CacheRename(t *testing.T, cache Renamer)

func (*Fixture) CacheRenameError

func (f *Fixture) CacheRenameError(t *testing.T, cache Renamer)

func (*Fixture) CatDetailGoodAdd

func (f *Fixture) CatDetailGoodAdd(t *testing.T)

func (*Fixture) CatDetailInvalidate

func (f *Fixture) CatDetailInvalidate(t *testing.T, cache Invalidater)

func (*Fixture) CatDetails

func (f *Fixture) CatDetails(t *testing.T)

func (*Fixture) CatDetailsBadAdds

func (f *Fixture) CatDetailsBadAdds(t *testing.T)

func (*Fixture) CatDetailsRename

func (f *Fixture) CatDetailsRename(t *testing.T)

func (*Fixture) CatDetailsRename2

func (f *Fixture) CatDetailsRename2(t *testing.T)

func (*Fixture) CatDetailsRenameBad

func (f *Fixture) CatDetailsRenameBad(t *testing.T)

func (*Fixture) CatDetailsRenameSame

func (f *Fixture) CatDetailsRenameSame(t *testing.T)

func (*Fixture) RemoveCatDetail

func (f *Fixture) RemoveCatDetail(t *testing.T)

func (*Fixture) RemoveCatDetail2

func (f *Fixture) RemoveCatDetail2(t *testing.T)

func (*Fixture) RemoveCatDetailError

func (f *Fixture) RemoveCatDetailError(t *testing.T)

func (*Fixture) RemoveCatDetailMissing

func (f *Fixture) RemoveCatDetailMissing(t *testing.T)

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
}

Jump to

Keyboard shortcuts

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