(t *testing.T)
| 163 | } |
| 164 | |
| 165 | func TestDeleteAccount_Success(t *testing.T) { |
| 166 | db, mock, err := sqlmock.New() |
| 167 | assert.NoError(t, err) |
| 168 | defer func() { _ = db.Close() }() |
| 169 | |
| 170 | ds := Datasource{Conn: db} |
| 171 | |
| 172 | mock.ExpectExec("DELETE FROM ledgerforge.accounts"). |
| 173 | WithArgs("acc1"). |
| 174 | WillReturnResult(sqlmock.NewResult(1, 1)) |
| 175 | |
| 176 | err = ds.DeleteAccount("acc1") |
| 177 | assert.NoError(t, err) |
| 178 | } |
| 179 | |
| 180 | func TestCreateAccount_QueryError(t *testing.T) { |
| 181 | db, mock, err := sqlmock.New() |
nothing calls this directly
no test coverage detected