Exemplo n.º 1
0
 public void Initialize()
 {
     EngineWrapper engineWrapper = new EngineWrapper();
     engineWrapper.Initialize(arguments);
 }
Exemplo n.º 2
0
 public void GetComponentID()
 {
     EngineWrapper engineWrapper = new EngineWrapper();
     engineWrapper.Initialize(arguments);
     Assert.AreEqual("HydroNet", engineWrapper.GetComponentID());
 }
Exemplo n.º 3
0
 public void PerformTimeStep()
 {
     EngineWrapper engineWrapper = new EngineWrapper();
     engineWrapper.Initialize(arguments);
     Assert.AreEqual(2, engineWrapper.HydroNetModel._waterBodies[0].CurrentStoredWater.Volume);
     engineWrapper.PerformTimeStep();
     engineWrapper.Finish();
 }
Exemplo n.º 4
0
        public void GetValues()
        {
            EngineWrapper engineWrapper = new EngineWrapper();
            engineWrapper.Initialize(arguments);
            engineWrapper.PerformTimeStep();

            Assert.AreEqual(1, ((IScalarSet)engineWrapper.GetValues("Leakage", "Groundwater boundary under Upper Lake")).Count);
            Assert.AreEqual(22.384, ((IScalarSet)engineWrapper.GetValues("Leakage", "Groundwater boundary under Upper Lake")).GetScalar(0),0.001);
        }
Exemplo n.º 5
0
        public void GetInputExchangeItems()
        {
            EngineWrapper engineWrapper = new EngineWrapper();
            engineWrapper.Initialize(arguments);

            Assert.AreEqual(2, engineWrapper.GetInputExchangeItemCount());

            List<HydroNumerics.OpenMI.Sdk.Backbone.InputExchangeItem> inputExchangeItemsList = new List<InputExchangeItem>();

            for (int i = 0; i < engineWrapper.GetInputExchangeItemCount(); i++)
            {
                inputExchangeItemsList.Add(engineWrapper.GetInputExchangeItem(i));
            }

            InputExchangeItem inputExchangeItem = inputExchangeItemsList.First(myVar => myVar.Quantity.ID == "Flow");
            Assert.AreEqual("Flow", inputExchangeItem.Quantity.ID);
            Assert.AreEqual("Inflow to Upper lake", inputExchangeItem.ElementSet.ID);
            Assert.AreEqual(ElementType.IDBased, inputExchangeItem.ElementSet.ElementType);

            inputExchangeItem = inputExchangeItemsList.First(myVar => myVar.Quantity.ID == "Head");
            Assert.AreEqual("Head", inputExchangeItem.Quantity.ID);
            Assert.AreEqual("Groundwater boundary under Upper Lake", inputExchangeItem.ElementSet.ID);
            Assert.AreEqual(ElementType.XYPolygon, inputExchangeItem.ElementSet.ElementType);
            Assert.AreEqual(6, inputExchangeItem.ElementSet.GetVertexCount(0));
        }
Exemplo n.º 6
0
        public void GetOutputExchangeItems()
        {
            EngineWrapper engineWrapper = new EngineWrapper();
            engineWrapper.Initialize(arguments);
            
            Assert.AreEqual(1, engineWrapper.GetOutputExchangeItemCount());

            List<HydroNumerics.OpenMI.Sdk.Backbone.OutputExchangeItem> outputExchangeItemsList = new List<OutputExchangeItem>();

            for (int i = 0; i < engineWrapper.GetOutputExchangeItemCount(); i++)
            {
                outputExchangeItemsList.Add(engineWrapper.GetOutputExchangeItem(i));
            }
            

            OutputExchangeItem outputExchangeItem = outputExchangeItemsList.First(myVar => myVar.Quantity.ID == "Leakage");
            Assert.AreEqual("Leakage", outputExchangeItem.Quantity.ID);
            Assert.AreEqual("Groundwater boundary under Upper Lake", outputExchangeItem.ElementSet.ID);
            Assert.AreEqual(ElementType.XYPolygon, outputExchangeItem.ElementSet.ElementType);
            Assert.AreEqual(6, outputExchangeItem.ElementSet.GetVertexCount(0));
            
        }
Exemplo n.º 7
0
 public void GetModelDescription()
 {
     EngineWrapper engineWrapper = new EngineWrapper();
     engineWrapper.Initialize(arguments);
     Assert.AreEqual("No modeldescription available", engineWrapper.GetModelDescription());
 }
Exemplo n.º 8
0
 public void GetModelID()
 {
     EngineWrapper engineWrapper = new EngineWrapper();
     engineWrapper.Initialize(arguments);
     Assert.AreEqual("HydroNet test model", engineWrapper.GetModelID());
 }
Exemplo n.º 9
0
 public void GetComponentDescription()
 {
     EngineWrapper engineWrapper = new EngineWrapper();
     engineWrapper.Initialize(arguments);
     Assert.AreEqual("Conceptual model for trasport of water and solutes", engineWrapper.GetComponentDescription());
 }