Exemplo n.º 1
0
        public void Convert_InputNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate call = () => DrainageConstructionConverter.Convert(null);

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

            Assert.AreEqual("input", exception.ParamName);
        }
Exemplo n.º 2
0
        public void Convert_ClayDikeAndDrainageConstructionPresentTrue_ReturnDrainageConstruction(MacroStabilityInwardsDikeSoilScenario soilScenario)
        {
            // Setup
            var random = new Random(21);
            var input  = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties())
            {
                DrainageConstructionPresent     = true,
                XCoordinateDrainageConstruction = random.NextRoundedDouble(),
                ZCoordinateDrainageConstruction = random.NextRoundedDouble(),
                DikeSoilScenario = soilScenario
            };

            // Call
            DrainageConstruction drainageConstruction = DrainageConstructionConverter.Convert(input);

            // Assert
            Assert.IsFalse(drainageConstruction.IsPresent);
            Assert.IsNaN(drainageConstruction.XCoordinate);
            Assert.IsNaN(drainageConstruction.ZCoordinate);
        }
Exemplo n.º 3
0
 private static WaternetCalculatorInput.ConstructionProperties CreateCalculatorInputConstructionProperties(IMacroStabilityInwardsWaternetInput input, IGeneralMacroStabilityInwardsWaternetInput generalInput)
 {
     return(new WaternetCalculatorInput.ConstructionProperties
     {
         SurfaceLine = input.SurfaceLine,
         SoilProfile = SoilProfileConverter.Convert(input.SoilProfileUnderSurfaceLine),
         DrainageConstruction = DrainageConstructionConverter.Convert(input),
         DikeSoilScenario = input.DikeSoilScenario,
         WaterLevelRiverAverage = input.WaterLevelRiverAverage,
         MinimumLevelPhreaticLineAtDikeTopRiver = input.MinimumLevelPhreaticLineAtDikeTopRiver,
         MinimumLevelPhreaticLineAtDikeTopPolder = input.MinimumLevelPhreaticLineAtDikeTopPolder,
         LeakageLengthOutwardsPhreaticLine3 = input.LeakageLengthOutwardsPhreaticLine3,
         LeakageLengthInwardsPhreaticLine3 = input.LeakageLengthInwardsPhreaticLine3,
         LeakageLengthOutwardsPhreaticLine4 = input.LeakageLengthOutwardsPhreaticLine4,
         LeakageLengthInwardsPhreaticLine4 = input.LeakageLengthInwardsPhreaticLine4,
         PiezometricHeadPhreaticLine2Outwards = input.PiezometricHeadPhreaticLine2Outwards,
         PiezometricHeadPhreaticLine2Inwards = input.PiezometricHeadPhreaticLine2Inwards,
         AdjustPhreaticLine3And4ForUplift = input.AdjustPhreaticLine3And4ForUplift,
         WaterVolumetricWeight = generalInput.WaterVolumetricWeight
     });
 }
Exemplo n.º 4
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
            }));
        }