main
 1namespace test
 2{
 3  using Machine.Specifications;
 4  using domain;
 5
 6  public class QuantitySpecs
 7  {
 8    public class when_using_the_same_unit_of_measure
 9    {
10      public class when_one_quantity_is_greater_than_another
11      {
12        It should_return_true=()=>
13        {
14          var result = new Quantity(2, new BOED()).IsGreaterThan(new Quantity(1, new BOED()));
15          result.ShouldBeTrue();
16        };
17      }
18      public class when_one_quantity_is_less_than_another
19      {
20        It should_return_false=()=>
21        {
22          var result = new Quantity(1, new BOED()).IsGreaterThan(new Quantity(2, new BOED()));
23          result.ShouldBeFalse();
24        };
25      }
26    }
27
28    public class when_using_different_unit_of_measures
29    {
30      public class when_one_quantity_is_greater_than_another
31      {
32        It should_return_true=()=>
33        {
34          var result = new Quantity(2, new BOED()).IsGreaterThan(new Quantity(6, new MCF()));
35          result.ShouldBeTrue();
36        };
37      }
38      public class when_one_quantity_is_less_than_another
39      {
40        It should_return_false=()=>
41        {
42          var result = new Quantity(1, new BOED()).IsGreaterThan(new Quantity(7, new MCF()));
43          result.ShouldBeFalse();
44        };
45      }
46    }
47    public class when_two_quantities_are_equal
48    {
49      It should_return_true=()=>
50      {
51        new Quantity(120, new MCF()).ShouldEqual(new Quantity(120, new MCF()));
52      };
53    }
54  }
55}