1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2024-11-24 08:12:13 +02:00
go-sqlxmock/README.md

11 lines
423 B
Markdown
Raw Normal View History

2014-02-05 17:21:07 +03:00
db = mock.Open("test", "")
db.ExpectTransactionBegin()
db.ExpectTransactionBegin().WillReturnError("some error")
db.ExpectQuery("SELECT bla").With(5, 8, "stat").WillReturnNone()
db.ExpectExec("UPDATE tbl SET").With(5, "val").WillReturnResult(res /* sql.Result */)
db.ExpectExec("INSERT INTO bla").With(5, 8, "stat").WillReturnResult(res /* sql.Result */)
db.ExpectQuery("SELECT bla").With(5, 8, "stat").WillReturnRows()