main
1using developwithpassion.bdd.contexts;
2using Gorilla.Commons.Testing;
3
4namespace MoMoney.Domain.Core
5{
6 [Concern(typeof (Money))]
7 public class when_adding_two_monies_together : concerns_for<Money>
8 {
9 it should_return_the_correct_money = () => result.should_be_equal_to(new Money(2, 98));
10
11
12 because b = () => { result = sut.add(new Money(1, 99)); };
13
14 public override Money create_sut()
15 {
16 return new Money(0, 99);
17 }
18
19 static Money result;
20 }
21
22 [Concern(typeof (Money))]
23 public class when_two_monies_of_the_same_value_are_compared_to_one_another : concerns_for<Money>
24 {
25 it they_should_be_equal = () => result.should_be_equal_to(true);
26
27
28 because b = () => { result = sut.Equals(new Money(1, 99)); };
29
30 public override Money create_sut()
31 {
32 return new Money(1, 99);
33 }
34
35 static bool result;
36 }
37
38 [Concern(typeof (Money))]
39 public class when_creating_a_money_with_pennies_greater_than_a_dollar : concerns_for<Money>
40 {
41 it should_create_a_money_representing_the_correct_amount_of_dollars_and_pennies =
42 () => sut.should_be_equal_to(new Money(3, 00));
43
44 public override Money create_sut()
45 {
46 return new Money(1, 200);
47 }
48 }
49}