testutil

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFailure

func AssertFailure(t *testing.T, pool *pgxpool.Pool, name string)

func AssertSuccess

func AssertSuccess(t *testing.T, pool *pgxpool.Pool, name string)

func SetupDB

func SetupDB(t *testing.T) (*pgxpool.Pool, *sql.DB)

Types

type DB

type DB struct {
	*mocks.DB
	// contains filtered or unexported fields
}

func NewDB

func NewDB(t *testing.T, opts ...Option) *DB

type Option

type Option func(db *DB)

func WithSuccessfulCommit

func WithSuccessfulCommit() Option

func WithSuccessfulRollback

func WithSuccessfulRollback() Option

func WithUnsuccessfulRollback

func WithUnsuccessfulRollback(with error) Option

func WithUnsuccessfulTransactionStart

func WithUnsuccessfulTransactionStart(with error) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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