MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / Test_userExampleDao_CreateByTx

Function Test_userExampleDao_CreateByTx

internal/dao/userExample_test.go:199–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func Test_userExampleDao_CreateByTx(t *testing.T) {
200 d := newUserExampleDao()
201 defer d.Close()
202 testData := d.TestData.(*model.UserExample)
203
204 d.SQLMock.ExpectBegin()
205 d.SQLMock.ExpectExec("INSERT INTO .*").
206 WithArgs(d.GetAnyArgs(testData)...).
207 WillReturnResult(sqlmock.NewResult(1, 1))
208 d.SQLMock.ExpectCommit()
209
210 _, err := d.IDao.(UserExampleDao).CreateByTx(d.Ctx, d.DB, testData)
211 if err != nil {
212 t.Fatal(err)
213 }
214}
215
216func Test_userExampleDao_DeleteByTx(t *testing.T) {
217 d := newUserExampleDao()

Callers

nothing calls this directly

Calls 5

newUserExampleDaoFunction · 0.85
GetAnyArgsMethod · 0.80
CloseMethod · 0.65
CreateByTxMethod · 0.65
FatalMethod · 0.45

Tested by

no test coverage detected