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