bobtesting

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithDatabase

func RunWithDatabase[T testing.TB](t T, name string, cb func(t T, tx *sqlx.Tx)) bool

func SetMigrate

func SetMigrate(cb func(db *sqlx.DB) error)

Types

type CountFactory

type CountFactory[T models.Model] struct {
	// contains filtered or unexported fields
}

func (*CountFactory[T]) Create

func (f *CountFactory[T]) Create(tx builder.QueryExecer) []T

type Factory

type Factory[T models.Model] func() T

func NewFactory

func NewFactory[T models.Model](cb func() T) Factory[T]

func (Factory[T]) Count

func (f Factory[T]) Count(count int) *CountFactory[T]

func (Factory[T]) Create

func (f Factory[T]) Create(tx builder.QueryExecer) T

func (Factory[T]) State

func (f Factory[T]) State(s func(T) T) Factory[T]

type Runner

type Runner[T any] interface {
	Run(name string, cb func(t T)) bool
}

Jump to

Keyboard shortcuts

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