コード例 #1
0
        public void GetSubMechanismModelId_Always_ReturnsExpectedValues(int subMechanismModelId, int?expectedSubMechanismModelId)
        {
            // Setup
            var input = new StructuresStabilityPointLowSillQuadraticCalculationInput(111, double.NaN,
                                                                                     Enumerable.Empty <HydraRingForelandPoint>(),
                                                                                     new HydraRingBreakWater(1, 1.1),
                                                                                     1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.10,
                                                                                     11.11, 12.12, 13.13, 14.14, 15.15, 16.16, 17.17,
                                                                                     18.18, 19.19, 20, 21.21, 22.22, 23.23, 24.24,
                                                                                     25.25, 26.26, 27.27, 28.28, 29.29, 30.30, 31.31,
                                                                                     32.32, 33.33, 34.34, 35.35, 36.36, 37.37, 38.38,
                                                                                     39.39, 40.40, 41.41, 42.42, 43.43, 44.44, 45.45,
                                                                                     46.46, 47.47, 48.48, 49.49, 50.50, 51.51, 52.52,
                                                                                     53.53, 54.54, 55.55, 56.56, 57.57);

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

            // Assert
            Assert.AreEqual(expectedSubMechanismModelId, actualSubMechanismModelId);
        }
コード例 #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                                        = 60.0;
            const double volumicWeightWater                                   = 1.1;
            const double gravitationalAcceleration                            = 2.2;
            const double levelCrestStructureMean                              = 3.3;
            const double levelCrestStructureStandardDeviation                 = 4.4;
            const double structureNormalOrientation                           = 5.5;
            const double factorStormDurationOpenStructure                     = 6.6;
            const double thresholdHeightOpenWeirMean                          = 7.7;
            const double thresholdHeightOpenWeirStandardDeviation             = 8.8;
            const double insideWaterLevelFailureConstructionMean              = 9.9;
            const double insideWaterLevelFailureConstructionStandardDeviation = 10.10;
            const double failureProbabilityRepairClosure                      = 11.11;
            const double failureCollisionEnergyMean                           = 12.12;
            const double failureCollisionEnergyVariation                      = 13.13;
            const double modelFactorCollisionLoadMean                         = 14.14;
            const double modelFactorCollisionLoadVariation                    = 15.15;
            const double shipMassMean          = 16.16;
            const double shipMassVariation     = 17.17;
            const double shipVelocityMean      = 18.18;
            const double shipVelocityVariation = 19.19;
            const int    levellingCount        = 20;
            const double probabilityCollisionSecondaryStructure = 21.21;
            const double flowVelocityStructureClosableMean      = 22.22;
            const double flowVelocityStructureClosableVariation = 23.23;
            const double insideWaterLevelMean = 24.24;
            const double insideWaterLevelStandardDeviation            = 25.25;
            const double allowedLevelIncreaseStorageMean              = 26.26;
            const double allowedLevelIncreaseStorageStandardDeviation = 27.27;
            const double modelFactorStorageVolumeMean = 28.28;
            const double modelFactorStorageVolumeStandardDeviation = 29.29;
            const double storageStructureAreaMean        = 30.30;
            const double storageStructureAreaVariation   = 31.31;
            const double modelFactorInflowVolume         = 32.32;
            const double flowWidthAtBottomProtectionMean = 33.33;
            const double flowWidthAtBottomProtectionStandardDeviation = 34.34;
            const double criticalOvertoppingDischargeMean             = 35.35;
            const double criticalOvertoppingDischargeVariation        = 36.36;
            const double failureProbabilityStructureWithErosion       = 37.37;
            const double stormDurationMean            = 38.38;
            const double stormDurationVariation       = 39.39;
            const double modelFactorLongThresholdMean = 40.40;
            const double modelFactorLongThresholdStandardDeviation = 41.41;
            const double bankWidthMean = 42.42;
            const double bankWidthStandardDeviation             = 43.43;
            const double evaluationLevel                        = 44.44;
            const double modelFactorLoadEffectMean              = 45.45;
            const double modelFactorLoadEffectStandardDeviation = 46.46;
            const double waveRatioMaxHN = 47.47;
            const double waveRatioMaxHStandardDeviation = 48.48;
            const double verticalDistance = 49.49;
            const double modificationFactorWavesSlowlyVaryingPressureComponent = 50.50;
            const double modificationFactorDynamicOrImpulsivePressureComponent = 51.51;
            const double constructiveStrengthQuadraticLoadModelMean            = 52.52;
            const double constructiveStrengthQuadraticLoadModelVariation       = 53.53;
            const double stabilityQuadraticLoadModelMean      = 54.54;
            const double stabilityQuadraticLoadModelVariation = 55.55;
            const double widthFlowAperturesMean = 56.56;
            const double widthFlowAperturesStandardDeviation = 57.57;

            // Call
            var input = new StructuresStabilityPointLowSillQuadraticCalculationInput(hydraulicBoundaryLocationId, sectionNormal,
                                                                                     forelandPoints, breakWater,
                                                                                     volumicWeightWater,
                                                                                     gravitationalAcceleration,
                                                                                     levelCrestStructureMean, levelCrestStructureStandardDeviation,
                                                                                     structureNormalOrientation,
                                                                                     factorStormDurationOpenStructure,
                                                                                     thresholdHeightOpenWeirMean, thresholdHeightOpenWeirStandardDeviation,
                                                                                     insideWaterLevelFailureConstructionMean, insideWaterLevelFailureConstructionStandardDeviation,
                                                                                     failureProbabilityRepairClosure,
                                                                                     failureCollisionEnergyMean, failureCollisionEnergyVariation,
                                                                                     modelFactorCollisionLoadMean, modelFactorCollisionLoadVariation,
                                                                                     shipMassMean, shipMassVariation,
                                                                                     shipVelocityMean, shipVelocityVariation,
                                                                                     levellingCount,
                                                                                     probabilityCollisionSecondaryStructure,
                                                                                     flowVelocityStructureClosableMean, flowVelocityStructureClosableVariation,
                                                                                     insideWaterLevelMean, insideWaterLevelStandardDeviation,
                                                                                     allowedLevelIncreaseStorageMean, allowedLevelIncreaseStorageStandardDeviation,
                                                                                     modelFactorStorageVolumeMean, modelFactorStorageVolumeStandardDeviation,
                                                                                     storageStructureAreaMean, storageStructureAreaVariation,
                                                                                     modelFactorInflowVolume,
                                                                                     flowWidthAtBottomProtectionMean, flowWidthAtBottomProtectionStandardDeviation,
                                                                                     criticalOvertoppingDischargeMean, criticalOvertoppingDischargeVariation,
                                                                                     failureProbabilityStructureWithErosion,
                                                                                     stormDurationMean, stormDurationVariation,
                                                                                     modelFactorLongThresholdMean, modelFactorLongThresholdStandardDeviation,
                                                                                     bankWidthMean, bankWidthStandardDeviation,
                                                                                     evaluationLevel,
                                                                                     modelFactorLoadEffectMean, modelFactorLoadEffectStandardDeviation,
                                                                                     waveRatioMaxHN, waveRatioMaxHStandardDeviation,
                                                                                     verticalDistance,
                                                                                     modificationFactorWavesSlowlyVaryingPressureComponent,
                                                                                     modificationFactorDynamicOrImpulsivePressureComponent,
                                                                                     constructiveStrengthQuadraticLoadModelMean, constructiveStrengthQuadraticLoadModelVariation,
                                                                                     stabilityQuadraticLoadModelMean, stabilityQuadraticLoadModelVariation,
                                                                                     widthFlowAperturesMean, widthFlowAperturesStandardDeviation);

            // Assert
            Assert.IsInstanceOf <StructuresStabilityPointCalculationInput>(input);
            Assert.AreEqual(hydraulicBoundaryLocationId, input.HydraulicBoundaryLocationId);
            Assert.AreEqual(1, input.CalculationTypeId);
            Assert.AreEqual(58, input.VariableId);
            Assert.AreEqual(HydraRingFailureMechanismType.StructuresStructuralFailure, 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());
        }