コード例 #1
0
        public void Convert_InputNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate call = () => UpliftVanSlipPlaneConstraintsConverter.Convert(null);

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(call);

            Assert.AreEqual("input", exception.ParamName);
        }
コード例 #2
0
        private static UpliftVanCalculatorInput CreateInputFromData(MacroStabilityInwardsInput inputParameters, GeneralMacroStabilityInwardsInput generalInput, RoundedDouble normativeAssessmentLevel)
        {
            RoundedDouble effectiveAssessmentLevel = GetEffectiveAssessmentLevel(inputParameters, normativeAssessmentLevel);

            return(new UpliftVanCalculatorInput(
                       new UpliftVanCalculatorInput.ConstructionProperties
            {
                AssessmentLevel = effectiveAssessmentLevel,
                SurfaceLine = inputParameters.SurfaceLine,
                SoilProfile = SoilProfileConverter.Convert(inputParameters.SoilProfileUnderSurfaceLine),
                DrainageConstruction = DrainageConstructionConverter.Convert(inputParameters),
                PhreaticLineOffsetsExtreme = PhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputExtreme),
                PhreaticLineOffsetsDaily = PhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputDaily),
                SlipPlane = UpliftVanSlipPlaneConverter.Convert(inputParameters),
                SlipPlaneConstraints = UpliftVanSlipPlaneConstraintsConverter.Convert(inputParameters),
                DikeSoilScenario = inputParameters.DikeSoilScenario,
                WaterLevelRiverAverage = inputParameters.WaterLevelRiverAverage,
                WaterLevelPolderExtreme = inputParameters.LocationInputExtreme.WaterLevelPolder,
                WaterLevelPolderDaily = inputParameters.LocationInputDaily.WaterLevelPolder,
                MinimumLevelPhreaticLineAtDikeTopRiver = inputParameters.MinimumLevelPhreaticLineAtDikeTopRiver,
                MinimumLevelPhreaticLineAtDikeTopPolder = inputParameters.MinimumLevelPhreaticLineAtDikeTopPolder,
                LeakageLengthOutwardsPhreaticLine3 = inputParameters.LeakageLengthOutwardsPhreaticLine3,
                LeakageLengthInwardsPhreaticLine3 = inputParameters.LeakageLengthInwardsPhreaticLine3,
                LeakageLengthOutwardsPhreaticLine4 = inputParameters.DikeSoilScenario != MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand
                                                             ? inputParameters.LeakageLengthOutwardsPhreaticLine4
                                                             : 1.0,
                LeakageLengthInwardsPhreaticLine4 = inputParameters.DikeSoilScenario != MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand
                                                            ? inputParameters.LeakageLengthInwardsPhreaticLine4
                                                            : 1.0,
                PiezometricHeadPhreaticLine2Outwards = inputParameters.PiezometricHeadPhreaticLine2Outwards,
                PiezometricHeadPhreaticLine2Inwards = inputParameters.PiezometricHeadPhreaticLine2Inwards,
                PenetrationLengthExtreme = inputParameters.LocationInputExtreme.PenetrationLength,
                PenetrationLengthDaily = inputParameters.LocationInputDaily.PenetrationLength,
                AdjustPhreaticLine3And4ForUplift = inputParameters.AdjustPhreaticLine3And4ForUplift,
                MoveGrid = inputParameters.MoveGrid,
                MaximumSliceWidth = inputParameters.MaximumSliceWidth,
                WaterVolumetricWeight = generalInput.WaterVolumetricWeight
            }));
        }
コード例 #3
0
        public void Convert_CreateZonesTrueAndZoningDeterminationTypeManual_ReturnsExpectedUpliftVanSlipPlaneConstraints()
        {
            // Setup
            var random = new Random(39);
            var input  = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties())
            {
                CreateZones = true,
                ZoningBoundariesDeterminationType = MacroStabilityInwardsZoningBoundariesDeterminationType.Manual,
                SlipPlaneMinimumDepth             = random.NextRoundedDouble(),
                SlipPlaneMinimumLength            = random.NextRoundedDouble(),
                ZoneBoundaryLeft  = random.NextRoundedDouble(),
                ZoneBoundaryRight = random.NextRoundedDouble()
            };

            // Call
            UpliftVanSlipPlaneConstraints constraints = UpliftVanSlipPlaneConstraintsConverter.Convert(input);

            // Assert
            Assert.IsFalse(constraints.AutomaticForbiddenZones);
            Assert.AreEqual(input.SlipPlaneMinimumDepth, constraints.SlipPlaneMinimumDepth, input.SlipPlaneMinimumDepth.GetAccuracy());
            Assert.AreEqual(input.SlipPlaneMinimumLength, constraints.SlipPlaneMinimumLength, input.SlipPlaneMinimumLength.GetAccuracy());
            Assert.AreEqual(input.ZoneBoundaryLeft, constraints.ZoneBoundaryLeft, input.ZoneBoundaryLeft.GetAccuracy());
            Assert.AreEqual(input.ZoneBoundaryRight, constraints.ZoneBoundaryRight, input.ZoneBoundaryRight.GetAccuracy());
        }