https://github.com/albertllousas/bank-kata-with-fsharp
https://github.com/albertllousas/bank-kata-with-fsharp
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/albertllousas/bank-kata-with-fsharp
- Owner: albertllousas
- Created: 2023-04-28T09:21:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-28T09:28:53.000Z (about 2 years ago)
- Last Synced: 2025-01-30T22:48:26.067Z (3 months ago)
- Language: F#
- Size: 5.55 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Bank Account Kata
https://github.com/sandromancuso/Bank-kata
## Acceptance test
```fsharp
test "Should print the bank statement after some money movements on a customer account" {
let result = Account.init []
|> Account.deposit 1000.00m (on("01/10/2012"))
|> Result.bind (Account.deposit 2000.00m (on("01/13/2012")))
|> Result.bind (Account.withdraw 500.00m (on("01/14/2012")))
|> Result.map BankStatement.printassertThat result (Ok([ " date || credit || debit || balance "
" 14/01/2012 || || 500.00 || 2500.00 "
" 13/01/2012 || 2000.00 || || 3000.00 "
" 10/01/2012 || 1000.00 || || 1000.00 "]))
}
```