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

Function TestBalance_ComputeBalance

model/model_test.go:77–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestBalance_ComputeBalance(t *testing.T) {
78 balance := &Balance{
79 CreditBalance: big.NewInt(1000),
80 DebitBalance: big.NewInt(300),
81 Balance: big.NewInt(0),
82 }
83 balance.computeBalance(false)
84 expected := big.NewInt(700)
85 assert.Equal(t, expected, balance.Balance)
86}
87
88func TestCanProcessTransaction(t *testing.T) {
89 t.Run("Sufficient funds", func(t *testing.T) {

Callers

nothing calls this directly

Calls 1

computeBalanceMethod · 0.95

Tested by

no test coverage detected