MCPcopy Create free account
hub / github.com/abice/go-enum / WithMockSQL

Function WithMockSQL

example/sql_1_11_test.go:84–99  ·  view source on GitHub ↗
(t testing.TB)

Source from the content-addressed store, hash-verified

82}
83
84func WithMockSQL(t testing.TB) (*MockSQL, func()) {
85 t.Helper()
86
87 ctrl := gomock.NewController(t)
88
89 mocks := &MockSQL{
90 Conn: NewMockConn(ctrl),
91 Stmt: NewMockStmt(ctrl),
92 Result: NewMockResult(ctrl),
93 Rows: NewMockRows(ctrl),
94 }
95
96 return mocks, func() {
97 ctrl.Finish()
98 }
99}
100
101func TestExampleSQL(t *testing.T) {
102 tests := map[string]struct {

Callers 4

TestExampleSQLFunction · 0.85
TestExampleSQLStrOnlyFunction · 0.85
TestExampleSQLIntOnlyFunction · 0.85
TestExampleSQLStrIntOnlyFunction · 0.85

Calls 4

NewMockConnFunction · 0.85
NewMockStmtFunction · 0.85
NewMockResultFunction · 0.85
NewMockRowsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…