test

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IDField = "ID"

Variables

This section is empty.

Functions

func AreTestStructObjectsSame

func AreTestStructObjectsSame(ts1 *TestStruct, ts2 *TestStruct) bool

func CreateDocker

func CreateDocker(user, pass, name string) (dockerPool *dockertest.Pool, dockerResource *dockertest.Resource, db *sql.DB)

func FatalIfTestStructNotDeletedInTheDatabase

func FatalIfTestStructNotDeletedInTheDatabase(t *testing.T, db *sql.DB, id uint64)

func ObjFieldInterfaces

func ObjFieldInterfaces(obj interface{}, includeID bool) []interface{}

func RemoveDocker

func RemoveDocker(dockerPool *dockertest.Pool, dockerResource *dockertest.Resource)

func TestStructJSON

func TestStructJSON() []byte

func TestStructURLValues

func TestStructURLValues() url.Values

Types

type TestStruct

type TestStruct struct {
	ID             uint64
	Flags          uint64
	PrimaryEmail   string `crud:"req"`
	EmailSecondary string `crud:"req email"`
	FirstName      string `crud:"req len:2,30"`
	LastName       string `crud:"req len:0,255"`
	Age            int    `crud:"val:1,120"`
	Price          int    `crud:"val:0,999"`
	PostCode       string `crud:"req len:6 regexp:^[0-9]{2}\\-[0-9]{3}$"`
	PostCode2      string `crud:"len:6" 2db_regexp:"^[0-9]{2}\\-[0-9]{3}$"`
	Password       string `json:"password"`
	Key            string `crud:"req uniq len:30,255"`
	CreatedAt      int64
	CreatedBy      uint64
	ModifiedAt     int64
	ModifiedBy     uint64
}

Test struct for all the tests

func FatalIfNoTestStructInTheDatabase

func FatalIfNoTestStructInTheDatabase(t *testing.T, db *sql.DB) *TestStruct

func TestStructWithData

func TestStructWithData() *TestStruct

Jump to

Keyboard shortcuts

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