MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestDeleteAccount_Success

Function TestDeleteAccount_Success

database/account_test.go:165–178  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func 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
180func TestCreateAccount_QueryError(t *testing.T) {
181 db, mock, err := sqlmock.New()

Callers

nothing calls this directly

Calls 2

DeleteAccountMethod · 0.95
CloseMethod · 0.45

Tested by

no test coverage detected