Documentation ¶
Index ¶
- func EnableDebugLog()
- func GetHTTPServerHost(server *httptest.Server) string
- func NewHTTPServer(response string) *httptest.Server
- func NewHTTPServerAtHost(response string, host string) *httptest.Server
- func RequireIndexRangeScan(t *testing.T, explain []ExplainRow)
- func TestMain(m *testing.M)
- type ExplainRow
- type MultiServerHelper
- type TestDB
- func (db *TestDB) Gorm() *gorm.DB
- func (db *TestDB) Mocker() sqlmock.Sqlmock
- func (db *TestDB) MustClose()
- func (db *TestDB) MustExec(sql string, values ...interface{})
- func (db *TestDB) MustExplain(sql string, values ...interface{}) []ExplainRow
- func (db *TestDB) MustMeetMockExpectation()
- func (db *TestDB) NewID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableDebugLog ¶
func EnableDebugLog()
func GetHTTPServerHost ¶
func NewHTTPServer ¶
func RequireIndexRangeScan ¶
func RequireIndexRangeScan(t *testing.T, explain []ExplainRow)
Types ¶
type ExplainRow ¶
type ExplainRow struct {
ID string `gorm:"column:id"`
}
type MultiServerHelper ¶
type MultiServerHelper struct { Servers []*httptest.Server // contains filtered or unexported fields }
func NewMultiServer ¶
func NewMultiServer(n int, responsePattern string) *MultiServerHelper
func (*MultiServerHelper) CloseAll ¶
func (m *MultiServerHelper) CloseAll()
func (*MultiServerHelper) GetEndpoints ¶
func (m *MultiServerHelper) GetEndpoints() []string
func (*MultiServerHelper) LastId ¶
func (m *MultiServerHelper) LastId() int
func (*MultiServerHelper) LastResp ¶
func (m *MultiServerHelper) LastResp() string
type TestDB ¶
type TestDB struct {
// contains filtered or unexported fields
}
func OpenTestDB ¶
func (*TestDB) MustExplain ¶
func (db *TestDB) MustExplain(sql string, values ...interface{}) []ExplainRow
func (*TestDB) MustMeetMockExpectation ¶
func (db *TestDB) MustMeetMockExpectation()
Click to show internal directories.
Click to hide internal directories.