Commit fe996bb

mo k <mo@mokhan.ca>
2012-04-20 21:30:31
add spec to convert MCF to BOED.
1 parent 50f78fc
Changed files (3)
src/domain/BOED.cs
@@ -39,7 +39,7 @@ namespace domain
   {
     public decimal Convert(decimal amount, IUnitOfMeasure units)
     {
-      // need to do actual conversion here;
+      if(units is BOED) return amount/6;
       return amount;
     }
   }
src/test/MCFSpecs.cs
@@ -0,0 +1,26 @@
+namespace test
+{
+  using Machine.Specifications;
+  using domain;
+  public class MCFSpecs{
+    Establish context = ()=>
+    {
+      sut = new MCF();
+    };
+    static MCF sut;
+    public class when_converting_6_mcf_to_boed
+    {
+      It should_return_one_boed=()=>
+      {
+        result.ShouldEqual(1m);
+      };
+
+      Because of = ()=>
+      {
+        result = sut.Convert(6m, new BOED());
+      };
+
+      static decimal result;
+    }
+  }
+}
src/test/test.csproj
@@ -51,6 +51,7 @@
     <Compile Include="BOEDSpecs.cs" />
     <Compile Include="CalculatorSpecs.cs" />
     <Compile Include="GasPlantSpecs.cs" />
+    <Compile Include="MCFSpecs.cs" />
     <Compile Include="Mock.cs" />
     <Compile Include="MonthSpecs.cs" />
     <Compile Include="ProductionScheduleSpecs.cs" />