main
1using Machine.Specifications;
2using solidware.financials.service.domain.accounting;
3
4namespace specs.unit.service.domain.accounting
5{
6 public class DetailAccountSpecs
7 {
8 public abstract class concern
9 {
10 Establish context = () =>
11 {
12 sut = DetailAccount.New(Currency.CAD);
13 };
14
15 static protected DetailAccount sut;
16 }
17
18 [Concern(typeof (DetailAccount))]
19 public class when_depositing_money_in_to_an_account : concern
20 {
21 Because b = () =>
22 {
23 sut.deposit(100.01m, Currency.CAD);
24 };
25
26 It should_adjust_the_balance = () =>
27 {
28 sut.balance().should_be_equal_to(new Quantity(100.01m, Currency.CAD));
29 };
30 }
31
32 [Concern(typeof (DetailAccount))]
33 public class when_withdrawing_money_from_an_account : concern
34 {
35 Because b = () =>
36 {
37 sut.deposit(100.01m);
38 sut.withdraw(10.00m, Currency.CAD);
39 };
40
41 It should_adjust_the_balance = () =>
42 {
43 sut.balance().should_be_equal_to(new Quantity(90.01m, Currency.CAD));
44 };
45 }
46 }
47}