diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-22 13:03:36 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-22 13:03:36 +0800 |
| commit | 2dedc30358d1724f60ab646b7a24e93f3672dff1 (patch) | |
| tree | 515258bf4b3e1546fdf97c481e12740c573ac7c8 /tests/FundLab.Api.Tests/StockSellTests.fs | |
| parent | 39965954968436911b32e774d32d3cca9527e4e2 (diff) | |
| download | fund-lab-2dedc30358d1724f60ab646b7a24e93f3672dff1.tar.gz | |
Debit available cash on manual stock and bond buys with ledger events (3d-34)
Diffstat (limited to 'tests/FundLab.Api.Tests/StockSellTests.fs')
| -rw-r--r-- | tests/FundLab.Api.Tests/StockSellTests.fs | 8 |
1 files changed, 4 insertions, 4 deletions
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) [<Fact>] 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) [<Fact>] 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) [<Fact>] 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) [<Fact>] member _.``a persisted snapshot price wins over the live quote when selling``() = |
