Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoTests ¶
func DoTests(t *testing.T, interactor Interactor)
Types ¶
type AccountOpts ¶
type AccountOpts struct {
OffBudget bool
}
type CategoryGroupOpts ¶
type CategoryGroupOpts struct {
}
type CategoryOpts ¶
type CategoryOpts struct {
Group beans.CategoryGroup
}
type Interactor ¶
type Interactor interface {
// Account
AccountCreate(t *testing.T, ctx Context, params beans.AccountCreate) (beans.ID, error)
AccountList(t *testing.T, ctx Context) ([]beans.AccountWithBalance, error)
AccountListTransactable(t *testing.T, ctx Context) ([]beans.Account, error)
AccountGet(t *testing.T, ctx Context, id beans.ID) (beans.Account, error)
// Budget
BudgetCreate(t *testing.T, ctx Context, name beans.Name) (beans.ID, error)
BudgetGet(t *testing.T, ctx Context, id beans.ID) (beans.Budget, error)
BudgetGetAll(t *testing.T, ctx Context) ([]beans.Budget, error)
// Category
CategoryCreate(t *testing.T, ctx Context, groupID beans.ID, name beans.Name) (beans.ID, error)
CategoryGet(t *testing.T, ctx Context, id beans.ID) (beans.Category, error)
CategoryGroupCreate(t *testing.T, ctx Context, name beans.Name) (beans.ID, error)
CategoryGroupGet(t *testing.T, ctx Context, id beans.ID) (beans.CategoryGroupWithCategories, error)
CategoryGetAll(t *testing.T, ctx Context) ([]beans.CategoryGroupWithCategories, error)
// Month
MonthGetOrCreate(t *testing.T, ctx Context, date beans.MonthDate) (beans.MonthWithDetails, error)
MonthUpdate(t *testing.T, ctx Context, monthID beans.ID, carryover beans.Amount) error
MonthSetCategoryAmount(t *testing.T, ctx Context, monthID beans.ID, categoryID beans.ID, amount beans.Amount) error
// Payee
PayeeCreate(t *testing.T, ctx Context, name beans.Name) (beans.ID, error)
PayeeGetAll(t *testing.T, ctx Context) ([]beans.Payee, error)
PayeeGet(t *testing.T, ctx Context, id beans.ID) (beans.Payee, error)
// Transaction
TransactionCreate(t *testing.T, ctx Context, params beans.TransactionCreateParams) (beans.ID, error)
TransactionGet(t *testing.T, ctx Context, id beans.ID) (beans.TransactionWithRelations, error)
TransactionUpdate(t *testing.T, ctx Context, params beans.TransactionUpdateParams) error
TransactionDelete(t *testing.T, ctx Context, ids []beans.ID) error
TransactionGetAll(t *testing.T, ctx Context) ([]beans.TransactionWithRelations, error)
TransactionGetSplits(t *testing.T, ctx Context, id beans.ID) ([]beans.Split, error)
// User
UserRegister(t *testing.T, ctx Context, username beans.Username, password beans.Password) error
UserLogin(t *testing.T, ctx Context, username beans.Username, password beans.Password) (beans.SessionID, error)
UserLogout(t *testing.T, ctx Context) error
UserGetMe(t *testing.T, ctx Context) (beans.UserPublic, error)
}
type TransactionOpts ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.