main
1namespace test
2{
3 using Machine.Specifications;
4 using domain;
5
6 public class MonthSpecs
7 {
8 public class when_comparing_months
9 {
10 It should_return_a_positive_number_when_the_first_month_is_greater_than_the_second_month =()=>
11 {
12 new Month(2012, 05).CompareTo(new Month(2012, 04)).ShouldBeGreaterThan(0);
13 };
14 It should_return_a_negative_number_when_the_first_month_is_less_than_the_second_month =()=>
15 {
16 new Month(2012, 04).CompareTo(new Month(2012, 05)).ShouldBeLessThan(0);
17 };
18 It should_return_a_zero_when_the_first_month_is_equal_to_the_second_month =()=>
19 {
20 new Month(2012, 04).CompareTo(new Month(2012, 04)).ShouldEqual(0);
21 };
22 }
23 public class when_checking_if_a_month_is_before_another
24 {
25 It should_return_true_when_it_is =()=>
26 {
27 new Month(2012, 02).IsBefore(new Month(2012, 03)).ShouldBeTrue();
28 };
29 It should_return_false_when_it_is_not=()=>
30 {
31 new Month(2012, 03).IsBefore(new Month(2012, 02)).ShouldBeFalse();
32 };
33 It should_return_false_when_it_is_the_same_month=()=>
34 {
35 new Month(2012, 02).IsBefore(new Month(2012, 02)).ShouldBeFalse();
36 };
37 }
38 }
39}