test

package module
v0.0.0-...-81b8297 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 10 Imported by: 0

README

test

基于testify库,将涉及数据库操作的单元测试中加载测试数据文件,数据库初始化等操作封装起来

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Suite

type Suite struct {
	suite.Suite

	Dns             string
	Db              *gorm.DB
	GormSingleModel bool
	Models          []interface{} // 初始化GORM模型 *指针*
	Cleaner         dbcleaner.DbCleaner
	SeedFileName    string
	Polluter        *polluter.Polluter
	Verbose         bool // 是否输出SQL语句
	// contains filtered or unexported fields
}

func (*Suite) Init

func (s *Suite) Init(dns string, models []interface{}, seedFileName string, verbose bool)

init suite info

func (*Suite) SetupSuite

func (s *Suite) SetupSuite()

func (*Suite) SetupTest

func (s *Suite) SetupTest()

func (*Suite) TearDownSuite

func (s *Suite) TearDownSuite()

func (*Suite) TearDownTest

func (s *Suite) TearDownTest()

Jump to

Keyboard shortcuts

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