summaryrefslogtreecommitdiff
path: root/spec/unit/utility/DateSpecs.cs
blob: 8bc1bb8b1f215d6515e9a5d54b29c93f04210d43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using gorilla.utility;
using Machine.Specifications;

namespace specs.unit.utility
{
    public class DateSpecs
    {
        [Subject(typeof (Date))]
        public class when_two_dates_that_represent_the_same_day_are_asked_if_they_are_equal
        {
            It should_return_true = () => result.should_be_equal_to(true);

            Because b = () =>
            {
                result = new Date(2008, 09, 25).Equals(new Date(2008, 09, 25));
            };

            static bool result;
        }

        [Subject(typeof (Date))]
        public class when_an_older_date_is_compared_to_a_younger_date
        {
            It should_return_a_positive_number = () => result.should_be_greater_than(0);

            Because b = () =>
            {
                result = new Date(2008, 09, 25).CompareTo(new Date(2007, 01, 01));
            };

            static int result;
        }
    }
}