Commit 5999f7d

mo k <mo@mokhan.ca>
2012-04-26 18:42:51
fix broken spec when over available plant capacity.
1 parent c6bf372
Changed files (3)
src/domain/Production.cs
@@ -25,7 +25,7 @@ namespace domain
 
     public virtual bool IsGreaterThanAvailableAt(IFacility facility)
     {
-      return facility.AvailableCapacityFor(this.month).IsGreaterThan(produced);
+      return produced.IsGreaterThan(facility.AvailableCapacityFor(this.month));
     }
 
     public IQuantity ProductionOf<T>() where T : ICommodity, new()
src/domain/Well.cs
@@ -43,9 +43,8 @@ namespace domain
       this.curve.Accept( production =>
       {
         if( production.OccursDuring(period)){
-          if(production.IsGreaterThanAvailableAt(facility)){
+          if(production.IsGreaterThanAvailableAt(facility))
             throw new Exception();
-          }
         }
       });
     }
src/test/Mock.cs
@@ -9,7 +9,7 @@ namespace test
       return MockRepository.GenerateMock<T>();
     }
   }
-  public static class Assertsions
+  public static class Assertions
   {
     public static void received<T>(this T mock,System.Action<T> action)
     {