testutils

package
v0.0.0-...-4a67540 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertError

func AssertError(t testing.TB, err error, expected string)

func AssertErrorAndCode

func AssertErrorAndCode(t testing.TB, err error, code string, msg string)

func AssertErrorCode

func AssertErrorCode(t testing.TB, err error, expected string)

func BudgetAuthContext

func BudgetAuthContext(t testing.TB, userID beans.ID, budget *beans.Budget) *beans.BudgetAuthContext

func HTTP

func HTTP(t testing.TB, f http.HandlerFunc, user *beans.User, budget *beans.Budget, body any, status int) string

func HTTPWithOptions

func HTTPWithOptions(t testing.TB, f http.HandlerFunc, options *HTTPOptions, user *beans.User, budget *beans.Budget, body any, status int) string

func MakeAccount

func MakeAccount(tb testing.TB, pool *pgxpool.Pool, name string, budgetID beans.ID) *beans.Account

func MakeBudget

func MakeBudget(tb testing.TB, pool *pgxpool.Pool, name string, userID beans.ID) *beans.Budget

func MakeCategory

func MakeCategory(tb testing.TB, pool *pgxpool.Pool, name string, groupID beans.ID, budgetID beans.ID) *beans.Category

func MakeCategoryGroup

func MakeCategoryGroup(tb testing.TB, pool *pgxpool.Pool, name string, budgetID beans.ID) *beans.CategoryGroup

func MakeIncomeCategoryGroup

func MakeIncomeCategoryGroup(tb testing.TB, pool *pgxpool.Pool, name string, budgetID beans.ID) *beans.CategoryGroup

func MakeMonth

func MakeMonth(tb testing.TB, pool *pgxpool.Pool, budgetID beans.ID, date beans.Date) *beans.Month

func MakeMonthCategory

func MakeMonthCategory(tb testing.TB, pool *pgxpool.Pool, monthID beans.ID, categoryID beans.ID, amount beans.Amount) *beans.MonthCategory

func MakePayee

func MakePayee(tb testing.TB, pool *pgxpool.Pool, name string, budgetID beans.ID) *beans.Payee

func MakeUser

func MakeUser(tb testing.TB, pool *pgxpool.Pool, username string) beans.ID

func MustExec

func MustExec(t testing.TB, pool *pgxpool.Pool, sql string)

func MustRollback

func MustRollback(t testing.TB, tx beans.Tx)

func NewDate

func NewDate(t testing.TB, date string) beans.Date

func NewEmptyID

func NewEmptyID() beans.ID

func NewMonthDate

func NewMonthDate(t testing.TB, date string) beans.MonthDate

func StartPool

func StartPool(tb testing.TB) (*pgxpool.Pool, func())

Types

type HTTPOptions

type HTTPOptions struct {
	URLParams map[string]string
}

Jump to

Keyboard shortcuts

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