main
1using System;
2using Machine.Specifications;
3using solidware.financials.service.domain;
4
5namespace specs.unit.service.domain
6{
7 public class DateSpecs
8 {
9 public abstract class concern {}
10
11 [Concern(typeof (Date))]
12 public class when_checking_if_a_date_is_before_another : concern
13 {
14 Establish c = () =>
15 {
16 today = DateTime.Now;
17 tomorrow = today.plus_days(1);
18 };
19
20 It should_return_true_when_it_is = () =>
21 {
22 today.is_before(tomorrow).should_be_true();
23 };
24
25 It should_return_false_when_it_is_not = () =>
26 {
27 tomorrow.is_before(today).should_be_false();
28 };
29
30 static Date today;
31 static Date tomorrow;
32 }
33
34 [Concern(typeof (Date))]
35 public class when_checking_if_a_date_is_after_another : concern
36 {
37 Establish c = () =>
38 {
39 today = DateTime.Now;
40 tomorrow = today.plus_days(1);
41 };
42
43 It should_return_true_when_it_is = () =>
44 {
45 tomorrow.is_after(today).should_be_true();
46 };
47
48 It should_return_false_when_it_is_not = () =>
49 {
50 today.is_after(tomorrow).should_be_false();
51 };
52
53 static Date today;
54 static Date tomorrow;
55 }
56 }
57}