(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestDeleteAccount_QueryError(t *testing.T) { |
| 301 | db, mock, err := sqlmock.New() |
| 302 | assert.NoError(t, err) |
| 303 | defer func() { _ = db.Close() }() |
| 304 | |
| 305 | ds := Datasource{Conn: db} |
| 306 | |
| 307 | mock.ExpectExec("DELETE FROM ledgerforge.accounts"). |
| 308 | WithArgs("acc1"). |
| 309 | WillReturnError(fmt.Errorf("database error")) |
| 310 | |
| 311 | err = ds.DeleteAccount("acc1") |
| 312 | assert.Error(t, err) |
| 313 | } |
nothing calls this directly
no test coverage detected