main
1using Machine.Specifications;
2using presentation.windows.server.domain.accounting;
3
4namespace unit.server.domain.accounting
5{
6 public class QuantitySpecs
7 {
8 public abstract class concern
9 {
10 Establish c = () =>
11 {
12 sut = new Quantity(100, Currency.CAD);
13 };
14
15 static protected Quantity sut;
16 }
17
18 [Subject(typeof (Quantity))]
19 public class when_checking_if_two_quantities_are_equal : concern
20 {
21 It should_return_true_when_they_represent_the_same_amount_and_units = () =>
22 {
23 sut.should_be_equal_to(new Quantity(100, Currency.CAD));
24 };
25
26 It should_return_false_when_they_are_not_the_same_amount = () =>
27 {
28 sut.should_not_be_equal_to(new Quantity(1, Currency.CAD));
29 };
30
31 It should_return_false_when_they_represent_different_currencies = () =>
32 {
33 sut.should_not_be_equal_to(new Quantity(100, Currency.USD));
34 };
35 }
36 }
37}