Example #1
0
        public void CalculateInflowAveragePredictionTest()
        {
            Hydro hydroCalculator = InitHydro();

            hydroCalculator.CalculateInflowAveragePrediction();
            List <double> testCase = new List <double>()
            {
                119.18, 68.44, 40.82, 83.412, 123.323, 140.645, 248.84, 129.02, 104.01
            };

            for (int i = 0; i < testCase.Count; i++)
            {
                testCase[i] = testCase[i] * 8.64 * 10;
                Console.WriteLine(testCase[i]);
                Console.WriteLine(hydroCalculator.InflowAveragePrediction[i]);
            }
            Assert.IsTrue(IsListEqual(testCase, hydroCalculator.InflowAveragePrediction));
        }
Example #2
0
        public void CalculateUtilizableCapacityTest()
        {
            Hydro hydroCalculator = InitHydro();

            hydroCalculator.CalculateRoundOrderArea();
            hydroCalculator.CalculateOriginalIrrigationRequirement();
            hydroCalculator.CalculateGrossIrrigationRequirement();
            hydroCalculator.CalculateAverageWaterSupplyOfCanalHead();
            hydroCalculator.CalculateAverageFlow();
            hydroCalculator.CalculateWaterRequirement();
            hydroCalculator.CalculateInflowAveragePrediction();
            hydroCalculator.CalculateUtilizableCapacity();
            List <double> testCase = new List <double>()
            {
                0, 0, 0, 0, 0, 0, 0, 0, 0
            };

            for (int i = 0; i < hydroCalculator.InflowAveragePrediction.Count; i++)
            {
                double restWater = (0 == i ? 18956.8062545455 : testCase[i - 1]);
                testCase[i] = restWater + hydroCalculator.InflowAveragePrediction[i] - hydroCalculator.WaterRequirement[i];
            }
            Assert.IsTrue(IsListEqual(testCase, hydroCalculator.UtilizableCapacity));
        }