(t *testing.T)
| 2038 | } |
| 2039 | |
| 2040 | func TestApplyTransaction_Debit(t *testing.T) { |
| 2041 | balanceID := "bln_test123" |
| 2042 | creditBalance := big.NewInt(1000) |
| 2043 | debitBalance := big.NewInt(500) |
| 2044 | |
| 2045 | txn := struct { |
| 2046 | PreciseAmount string |
| 2047 | Source string |
| 2048 | Destination string |
| 2049 | CreatedAt time.Time |
| 2050 | EffectiveDate time.Time |
| 2051 | }{ |
| 2052 | PreciseAmount: "100", |
| 2053 | Source: balanceID, |
| 2054 | Destination: "other_balance", |
| 2055 | CreatedAt: time.Now(), |
| 2056 | EffectiveDate: time.Now(), |
| 2057 | } |
| 2058 | |
| 2059 | newCredit, newDebit, err := applyTransaction(txn, balanceID, creditBalance, debitBalance) |
| 2060 | assert.NoError(t, err) |
| 2061 | assert.Equal(t, int64(1000), newCredit.Int64()) |
| 2062 | assert.Equal(t, int64(600), newDebit.Int64()) |
| 2063 | } |
| 2064 | |
| 2065 | func TestApplyTransaction_Credit(t *testing.T) { |
| 2066 | balanceID := "bln_test123" |
nothing calls this directly
no test coverage detected