Ejemplo n.º 1
0
        public void GetSubMechanismModelId_Always_ReturnsExpectedValues(int subMechanismModelId, int?expectedSubMechanismModelId)
        {
            // Setup
            var input = new StructuresClosureFloodedCulvertCalculationInput(111, double.NaN,
                                                                            Enumerable.Empty <HydraRingForelandPoint>(),
                                                                            new HydraRingBreakWater(1, 1.1),
                                                                            1.1, 222, 333, 5.5, 6, 7.7, 8.8, 11, 22, 33, 44, 55,
                                                                            66, 77, 88, 99, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);

            // Call
            int?actualSubMechanismModelId = input.GetSubMechanismModelId(subMechanismModelId);

            // Assert
            Assert.AreEqual(expectedSubMechanismModelId, actualSubMechanismModelId);
        }
Ejemplo n.º 2
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            const int hydraulicBoundaryLocationId = 1000;
            IEnumerable <HydraRingForelandPoint> forelandPoints = Enumerable.Empty <HydraRingForelandPoint>();
            var breakWater = new HydraRingBreakWater(1, 1.1);

            const double sectionNormal                                = 27.7;
            const double gravitationalAcceleration                    = 1.1;
            const double factorStormDurationOpenStructure             = 2.2;
            const double failureProbabilityOpenStructure              = 3.3;
            const double failureProbabilityReparation                 = 4.4;
            const int    identicalApertures                           = 5;
            const double allowedLevelIncreaseStorageMean              = 6.6;
            const double allowedLevelIncreaseStorageStandardDeviation = 7.7;
            const double modelFactorStorageVolumeMean                 = 8.8;
            const double modelFactorStorageVolumeStandardDeviation    = 9.9;
            const double storageStructureAreaMean                     = 10.0;
            const double storageStructureAreaVariation                = 11.1;
            const double modelFactorInflowVolume                      = 12.2;
            const double flowWidthAtBottomProtectionMean              = 13.3;
            const double flowWidthAtBottomProtectionStandardDeviation = 14.4;
            const double criticalOvertoppingDischargeMean             = 15.5;
            const double criticalOvertoppingDischargeVariation        = 16.6;
            const double failureProbabilityStructureWithErosion       = 17.7;
            const double stormDurationMean                            = 18.8;
            const double stormDurationVariation                       = 19.9;
            const double probabilityOpenStructureBeforeFlooding       = 20.0;
            const double drainCoefficientMean                         = 21.1;
            const double drainCoefficientStandardDeviation            = 22.2;
            const double areaFlowAperturesMean                        = 23.3;
            const double areaFlowAperturesStandardDeviation           = 24.4;
            const double insideWaterLevelMean                         = 25.5;
            const double insideWaterLevelStandardDeviation            = 26.6;

            // Call
            var input = new StructuresClosureFloodedCulvertCalculationInput(hydraulicBoundaryLocationId,
                                                                            sectionNormal,
                                                                            forelandPoints, breakWater,
                                                                            gravitationalAcceleration,
                                                                            factorStormDurationOpenStructure,
                                                                            failureProbabilityOpenStructure,
                                                                            failureProbabilityReparation,
                                                                            identicalApertures,
                                                                            allowedLevelIncreaseStorageMean, allowedLevelIncreaseStorageStandardDeviation,
                                                                            modelFactorStorageVolumeMean, modelFactorStorageVolumeStandardDeviation,
                                                                            storageStructureAreaMean, storageStructureAreaVariation,
                                                                            modelFactorInflowVolume,
                                                                            flowWidthAtBottomProtectionMean, flowWidthAtBottomProtectionStandardDeviation,
                                                                            criticalOvertoppingDischargeMean, criticalOvertoppingDischargeVariation,
                                                                            failureProbabilityStructureWithErosion,
                                                                            stormDurationMean, stormDurationVariation,
                                                                            probabilityOpenStructureBeforeFlooding,
                                                                            drainCoefficientMean, drainCoefficientStandardDeviation,
                                                                            areaFlowAperturesMean, areaFlowAperturesStandardDeviation,
                                                                            insideWaterLevelMean, insideWaterLevelStandardDeviation);

            // Assert
            Assert.IsInstanceOf <StructuresClosureCalculationInput>(input);
            Assert.AreEqual(hydraulicBoundaryLocationId, input.HydraulicBoundaryLocationId);
            Assert.AreEqual(1, input.CalculationTypeId);
            Assert.AreEqual(58, input.VariableId);
            Assert.AreEqual(HydraRingFailureMechanismType.StructuresClosure, input.FailureMechanismType);

            HydraRingSection section = input.Section;

            Assert.AreEqual(1, section.SectionId);
            Assert.IsNaN(section.SectionLength);
            Assert.AreEqual(sectionNormal, section.CrossSectionNormal);
            Assert.AreSame(forelandPoints, input.ForelandPoints);
            Assert.AreSame(breakWater, input.BreakWater);
            HydraRingDataEqualityHelper.AreEqual(GetDefaultVariables().ToArray(), input.Variables.ToArray());
        }