Documentation
¶
Index ¶
- func AssertTableData(t *testing.T)
- func DebugMode(mode bool)
- func Init(collection *FixtureCollection)
- func InitSetupFunc(loadConfigFunc func() ConfigMap)
- type ColumnName
- type ConfigMap
- type DataValue
- type DbConfig
- type DbName
- type FixtureCollection
- type FixtureData
- type FixtureElement
- type RowData
- type TableData
- type TableName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertTableData ¶
Compare Fixture 'After' Table Data to Real Database Table Data
If debug mode on, print the log regardless of the result value ¶
If return value is true, expected and real data same.
func Init ¶
func Init(collection *FixtureCollection)
1. Load config
Config function is initialized by 'InitSetupFunc'. If you want to set load config function, call 'InitSetupFunc'.
2. Connect to Database
It is set based on the configuration file. If the 'SqlBytes' field of 'Config' struct is set, Database executes 'SqlBytes'. 'SqlBytes' means byte stream of '.sql' file.
3. Insert Database row data, that defined in the 'Before function' field of 'FixtureElement'.
func InitSetupFunc ¶
func InitSetupFunc(loadConfigFunc func() ConfigMap)
Initialized 'setup' function. loadConfigFunc is called by 'Init' function
Types ¶
type ColumnName ¶
type ColumnName = string
type FixtureCollection ¶
type FixtureCollection map[DbName]*FixtureElement
type FixtureData ¶
type FixtureElement ¶
type FixtureElement struct {
Before func() FixtureData
After func() FixtureData
}
type RowData ¶
type RowData = map[ColumnName]DataValue
Click to show internal directories.
Click to hide internal directories.