main
  1namespace test
  2{
  3  using System;
  4  using System.Collections.Generic;
  5  using System.Linq;
  6  using Machine.Specifications;
  7  using domain;
  8  using utility;
  9
 10  public class ProductionScheduleSpecs
 11  {
 12    public class when_estimating_production
 13    {
 14      Establish context = () =>
 15      {
 16          sut = new ProductionSchedule();
 17      };
 18
 19      static ProductionSchedule sut;
 20
 21      public class when_100_percent_working_interest
 22      {
 23        Establish context = ()=>
 24        {
 25          parkland100Percent = new Oppurtunity();
 26          parkland100Percent.WorkingInterest(100m.Percent());
 27          var declineCurve = new DeclineCurve();
 28          declineCurve.Composition<Gas>(100m.Percent());
 29          declineCurve.Add(0, 100.BOED());
 30          parkland100Percent.DeclinesUsing(declineCurve);
 31
 32          jan2013 = new Month(2013, 01);
 33        };
 34
 35        Because of = ()=>
 36        {
 37          sut.Include(parkland100Percent.BringOnlineOn(jan2013));
 38        };
 39
 40        It should_be_able_to_tell_the_estimated_total_production_for_any_month= () =>
 41        {
 42          sut.EstimatedGrossProductionFor<All>(jan2013).ShouldEqual(100.BOED());
 43        };
 44
 45        It should_be_able_to_tell_the_estimated_production_for_gas=()=>
 46        {
 47          sut.EstimatedGrossProductionFor<Gas>(jan2013).ShouldEqual(100.BOED());
 48        };
 49
 50        It should_be_able_to_tell_the_estimated_production_for_oil=()=>
 51        {
 52          sut.EstimatedGrossProductionFor<Oil>(jan2013).ShouldEqual(0.BOED());
 53        };
 54
 55        It should_be_able_to_tell_the_estimated_production_for_ngl=()=>
 56        {
 57          sut.EstimatedGrossProductionFor<NGL>(jan2013).ShouldEqual(0.BOED());
 58        };
 59
 60        It should_be_able_to_tell_the_estimated_production_for_condensate=()=>
 61        {
 62          sut.EstimatedGrossProductionFor<Condensate>(jan2013).ShouldEqual(0.BOED());
 63        };
 64
 65        static Oppurtunity parkland100Percent;
 66        static Month jan2013;
 67      }
 68
 69      public class when_reduced_working_interest
 70      {
 71        Establish context = ()=> 
 72        {
 73          parkland75Percent = new Oppurtunity();
 74          parkland75Percent.WorkingInterest(75m.Percent());
 75          var declineCurve = new DeclineCurve();
 76          declineCurve.Composition<Gas>(50m.Percent());
 77          declineCurve.Composition<Oil>(50m.Percent());
 78          declineCurve.Add(0, 100.BOED());
 79          parkland75Percent.DeclinesUsing(declineCurve);
 80          jan2013 = new Month(2013, 01);
 81        };
 82
 83        Because of = ()=>
 84        {
 85          sut.Include(parkland75Percent.BringOnlineOn(jan2013));
 86        };
 87
 88        It should_be_able_to_tell_the_estimated_net_total_production_for_any_month = () =>
 89        {
 90          sut.AcceptAndReturnResultFrom(new EstimatedNetProductionFor<All>(jan2013)).ShouldEqual(75.BOED());
 91        };
 92
 93        It should_be_able_to_tell_the_estimated_net_production_for_oil = ()=>
 94        {
 95          sut.EstimatedNetProductionFor<Oil>(jan2013).ShouldEqual(37.5m.BOED());
 96        };
 97
 98        It should_be_able_to_tell_the_estimated_net_production_for_gas = ()=>
 99        {
100          sut.EstimatedNetProductionFor<Gas>(jan2013).ShouldEqual(37.5m.BOED());
101        };
102
103        It should_be_able_to_tell_the_estimated_net_production_for_ngl = ()=>
104        {
105          sut.EstimatedNetProductionFor<NGL>(jan2013).ShouldEqual(0m.BOED());
106        };
107
108        It should_be_able_to_tell_the_estimated_net_production_for_condensate = ()=>
109        {
110          sut.EstimatedNetProductionFor<Condensate>(jan2013).ShouldEqual(0m.BOED());
111        };
112
113        static Month jan2013;
114        static Oppurtunity parkland75Percent;
115      }
116    }
117  }
118}