public void LayerRate_Set4_A3_Count() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx"); WFInt.OpenFile(sfile); double dRate = 92987.929; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); int Actual = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Count; int Expected = 1; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual); } }
public void LayerRate_Set4_A1_GetAt_OilRate() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx"); WFInt.OpenFile(sfile); double dRate = 21780.34; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); int i = 0; double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetAt(i).AddRef().OilRate, 2); double Expected = 16335.25; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected)); } }
public void LayerRate_Set4_A2_Item_WaterRate() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx"); WFInt.OpenFile(sfile); double dRate = 21780.34; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); string sName = "Layer 1"; double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Item(sName).AddRef().WaterRate, 2); double Expected = 5445.08; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected)); } }
public void LayerRate_Set3_A2_Item_WaterRate() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\one layer active and one is inactive.wflx"); WFInt.OpenFile(sfile); double dRate = 92987.929; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); string sName = "Layer 2"; double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Item(sName).AddRef().WaterRate, 2); double Expected = 23246.98; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected)); } }
public void LayerRate_Set4_A1_GetAt_Name() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx"); WFInt.OpenFile(sfile); double dRate = 21780.34; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); int i = 0; string Actual = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetAt(i).AddRef().Name; string Expected = "Layer 1"; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual); } }
public void LayerRate_Set2_A3_Item_OilRate() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx"); WFInt.OpenFile(sfile); double dRate = 37100; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); string sName = "Layer 1"; double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Item(sName).AddRef().OilRate, 0); double Expected = 27825.0; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected)); } }
public void LayerRate_Set2_A5_RemoveAll() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile1 = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx"); string sfile2 = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer_RemoveAll.wflx"); WFInt.OpenFile(sfile1); WFInt.SaveFile(sfile2); double dRate = 37100; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().RemoveAll(); WFInt.SaveFile(sfile2); WFInt.OpenFile(sfile2); int Actual = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Count; int Expected = 0; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual); } }
public void LayerRate_Set2_A2_GetAt_GasRate() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx"); WFInt.OpenFile(sfile); double dRate = 37100; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); int i = 0; double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetAt(i).AddRef().GasRate, 2); double Expected = 13.91; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected)); } }
public void LayerRate_Set2_A1_Add() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); string sfile1 = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx"); //string sfile2 = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer_Save1.wflx");(model doesnot exist!!) WFInt.OpenFile(sfile1); double dRate = 37100; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); int Count = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Count; string sName = "Layer 2"; WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Add(sName); int Actual = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Count; int Expected = 2; WFInt.EndWellFlo(); Assert.AreEqual(Expected, Actual); } }
public void LayerRateCalculator_GetMultipleLayerRatesData() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); LayerRates pVal = new LayerRates(); pVal.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer/PCP-Multiphase.wflx"); WFInt.OpenFile(sfile); double dRate = 150.0; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); WFInt.GetLayerRateCalculator().AddRef().GetLayerRatesData(pVal); double WaterRate = Math.Round(pVal.GetAt(0).AddRef().WaterRate, 1); double OilRate = Math.Round(pVal.GetAt(0).AddRef().OilRate, 1); Assert.AreEqual(30, WaterRate, DeltaFraction.Default(30)); Assert.AreEqual(119.9999, OilRate, DeltaFraction.Default(119.9999)); } }
public void LayerRateCalculator_GetLayerRatesData() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); LayerRates pVal = new LayerRates(); pVal.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx"); WFInt.OpenFile(sfile); double dRate = 37178.3; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); WFInt.GetLayerRateCalculator().AddRef().GetLayerRatesData(pVal); double WaterRate = Math.Round(pVal.GetAt(0).AddRef().WaterRate, 1); double OilRate = Math.Round(pVal.GetAt(0).AddRef().OilRate, 1); Assert.AreEqual(9294.6, WaterRate, DeltaFraction.Default(9294.6)); Assert.AreEqual(27883.8, OilRate, DeltaFraction.Default(27883.8)); } }
public void LayerRateCalculator_GetFlowRateDataByName() { using (new LifeTimeScope()) { WFloInterface WFInt = new WFloInterface(); WFInt.AddRef(); FlowRate pVal = new FlowRate(); pVal.AddRef(); string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx"); WFInt.OpenFile(sfile); double dRate = 37178.3; WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate); WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetFlowRateDataByName("Layer 1", pVal); double WaterRate = pVal.WaterRate; double OilRate = pVal.OilRate; Assert.AreEqual(9294.6, WaterRate, DeltaFraction.Default(9294.6)); Assert.AreEqual(27883.8, OilRate, DeltaFraction.Default(27883.8)); } }