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

Function TestDeleteMatchingRule_Success

database/reconciliation_test.go:655–669  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

653}
654
655func TestDeleteMatchingRule_Success(t *testing.T) {
656 db, mock, err := sqlmock.New()
657 assert.NoError(t, err)
658 defer func() { _ = db.Close() }()
659
660 ds := Datasource{Conn: db}
661 ctx := context.TODO()
662
663 mock.ExpectExec("DELETE FROM ledgerforge.matching_rules WHERE rule_id").
664 WithArgs("rule1").
665 WillReturnResult(sqlmock.NewResult(0, 1))
666
667 err = ds.DeleteMatchingRule(ctx, "rule1")
668 assert.NoError(t, err)
669}
670
671func TestDeleteMatchingRule_NotFound(t *testing.T) {
672 db, mock, err := sqlmock.New()

Callers

nothing calls this directly

Calls 2

DeleteMatchingRuleMethod · 0.95
CloseMethod · 0.45

Tested by

no test coverage detected