e2e

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModelToRows

func ModelToRows(dst interface{}) *sqlmock.Rows

Types

type DbMock

type DbMock struct {
	// contains filtered or unexported fields
}

func New

func New(tb TestingTB) *DbMock

func (*DbMock) Create

func (m *DbMock) Create(model interface{}) *DbMock

func (*DbMock) DB

func (m *DbMock) DB() *gorm.DB

func (*DbMock) Delete

func (m *DbMock) Delete(model schema.Tabler) *DbMock

func (*DbMock) ExpectBegin

func (m *DbMock) ExpectBegin() *DbMock

func (*DbMock) ExpectCommit

func (m *DbMock) ExpectCommit() *DbMock

func (*DbMock) ExpectRollback

func (m *DbMock) ExpectRollback() *DbMock

func (*DbMock) Find

func (m *DbMock) Find(model schema.Tabler) *DbMock

func (*DbMock) Mock

func (m *DbMock) Mock() sqlmock.Sqlmock

func (*DbMock) Return

func (m *DbMock) Return(returns interface{})

func (*DbMock) ReturnErr

func (m *DbMock) ReturnErr(err error)

func (*DbMock) ReturnResult

func (m *DbMock) ReturnResult(lastInsertID int64, rowsAffected int64)

func (*DbMock) Sql

func (m *DbMock) Sql(sql string) *DbMock

func (*DbMock) Update

func (m *DbMock) Update(model schema.Tabler) *DbMock

func (*DbMock) WithArgs

func (m *DbMock) WithArgs(args ...driver.Value) *DbMock

func (*DbMock) WithArgsChecker

func (m *DbMock) WithArgsChecker(checker func(args []driver.Value) error) *DbMock

func (*DbMock) WithOpt

func (m *DbMock) WithOpt(checker sqlmock.Matcher) *DbMock

WithOpt Opt=[exec,query]

func (*DbMock) WithPrepare

func (m *DbMock) WithPrepare() *DbMock

type TestingTB

type TestingTB interface {
	// Name Returns current test name.
	Name() string
	Cleanup(f func())
	Logf(fmt string, args ...interface{})
	Fatalf(format string, args ...interface{})
	Errorf(message string, args ...interface{})
}

Jump to

Keyboard shortcuts

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