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

Function TestTransaction_ToJSON

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

Source from the content-addressed store, hash-verified

771}
772
773func TestTransaction_ToJSON(t *testing.T) {
774 txn := &Transaction{
775 TransactionID: "txn_123",
776 Amount: 100.50,
777 Currency: "USD",
778 Reference: "ref_abc",
779 Source: "src_123",
780 Destination: "dst_456",
781 Status: "APPLIED",
782 }
783
784 jsonBytes, err := txn.ToJSON()
785
786 assert.NoError(t, err)
787 assert.NotNil(t, jsonBytes)
788 assert.Contains(t, string(jsonBytes), "txn_123")
789 assert.Contains(t, string(jsonBytes), "100.5")
790 assert.Contains(t, string(jsonBytes), "USD")
791}
792
793func TestPrecisionBankersRound(t *testing.T) {
794 tests := []struct {

Callers

nothing calls this directly

Calls 1

ToJSONMethod · 0.95

Tested by

no test coverage detected