From 2dedc30358d1724f60ab646b7a24e93f3672dff1 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 22 Sep 2026 13:03:36 +0800 Subject: Debit available cash on manual stock and bond buys with ledger events (3d-34) --- tests/FundLab.Api.Tests/StockSellTests.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/FundLab.Api.Tests/StockSellTests.fs') diff --git a/tests/FundLab.Api.Tests/StockSellTests.fs b/tests/FundLab.Api.Tests/StockSellTests.fs index 972293a..fb17a50 100644 --- a/tests/FundLab.Api.Tests/StockSellTests.fs +++ b/tests/FundLab.Api.Tests/StockSellTests.fs @@ -129,7 +129,7 @@ type StockSellTests(fixture: PostgresFixture) = let status, fundBody = fund sellQuotes fundId Assert.Equal(200, status) - Assert.Contains("\"availableCash\":\"1480.00\"", fundBody) + Assert.Contains("\"availableCash\":\"480.00\"", fundBody) [] member _.``selling all units removes the position row and credits the proceeds``() = @@ -150,7 +150,7 @@ type StockSellTests(fixture: PostgresFixture) = Assert.Contains("\"positions\":[]", positionsBody) let _, fundBody = fund sellQuotes fundId - Assert.Contains("\"availableCash\":\"2200.00\"", fundBody) + Assert.Contains("\"availableCash\":\"1200.00\"", fundBody) [] member _.``overselling is rejected with a reason and leaves cash and position unchanged``() = @@ -171,7 +171,7 @@ type StockSellTests(fixture: PostgresFixture) = Assert.Contains("\"quantity\":\"100.00000000\"", positionsBody) let _, fundBody = fund quotes fundId - Assert.Contains("\"availableCash\":\"1000.00\"", fundBody) + Assert.Contains("\"availableCash\":\"0.00\"", fundBody) [] member _.``valuation after a partial sale prices only the remaining units``() = @@ -215,7 +215,7 @@ type StockSellTests(fixture: PostgresFixture) = Assert.DoesNotContain("\"quantity\":\"40.00000000\"", positionsBody) let _, fundBody = fund quotes fundId - Assert.Contains("\"availableCash\":\"1300.00\"", fundBody) + Assert.Contains("\"availableCash\":\"300.00\"", fundBody) [] member _.``a persisted snapshot price wins over the live quote when selling``() = -- cgit v1.2.3