test

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualCount

func EqualCount(t *testing.T, db *sql.DB, expected int, table string, filter squirrel.Sqlizer) int

EqualCount asserts that the count of rows matches the expected value given the table and WHERE query and args.EqualCount Note that this is a simple COUNT of rows in a single table. More complex queries should be constructed by hand.

func GetDatabase

func GetDatabase(t *testing.T, inits ...DBInitializer) (name string, testDB *sql.DB)

GetDatabase gets a test database

Types

type DBInitializer

type DBInitializer func(context.Context, *sql.DB) error

DBInitializer is the function that initializes the data base for testing

Jump to

Keyboard shortcuts

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