public void CalculateDaily_WithInput_SetsInputOnCalculator()
        {
            // Setup
            MacroStabilityInwardsInput input = testCalculation.InputParameters;

            using (new MacroStabilityInwardsCalculatorFactoryConfig())
            {
                // Call
                WaternetCalculationService.CalculateDaily(input, new GeneralMacroStabilityInwardsInput());

                // Assert
                var factory = (TestMacroStabilityInwardsCalculatorFactory)MacroStabilityInwardsCalculatorFactory.Instance;
                WaternetCalculatorInput actualInput = factory.LastCreatedWaternetDailyCalculator.Input;

                CalculatorInputAssert.AssertDailyInput(input, actualInput);
            }
        }
        public void ValidateExtreme_WithInput_SetsInputOnCalculator()
        {
            // Setup
            RoundedDouble assessmentLevel    = new Random(21).NextRoundedDouble();
            MacroStabilityInwardsInput input = testCalculation.InputParameters;

            using (new MacroStabilityInwardsCalculatorFactoryConfig())
            {
                // Call
                WaternetCalculationService.ValidateExtreme(input, new GeneralMacroStabilityInwardsInput(), assessmentLevel);

                // Assert
                var factory = (TestMacroStabilityInwardsCalculatorFactory)MacroStabilityInwardsCalculatorFactory.Instance;
                WaternetCalculatorInput actualInput = factory.LastCreatedWaternetExtremeCalculator.Input;

                CalculatorInputAssert.AssertExtremeInput(input, actualInput, assessmentLevel);
            }
        }
Пример #3
0
        public void Convert_WithSoilProfile_ReturnSoilProfile()
        {
            // Setup
            var random = new Random(22);

            MacroStabilityInwardsSoilLayer2D soilLayer1 = CreateRandomSoilLayer(22, new[]
            {
                CreateRandomSoilLayer(23, Enumerable.Empty <MacroStabilityInwardsSoilLayer2D>()),
                CreateRandomSoilLayer(24, Enumerable.Empty <MacroStabilityInwardsSoilLayer2D>())
            });

            MacroStabilityInwardsSoilLayer2D soilLayer2 = CreateRandomSoilLayer(25, new[]
            {
                CreateRandomSoilLayer(26, new[]
                {
                    CreateRandomSoilLayer(27, Enumerable.Empty <MacroStabilityInwardsSoilLayer2D>())
                })
            });

            var preconsolidationStress = new MacroStabilityInwardsPreconsolidationStress(new Point2D(random.NextDouble(), random.NextDouble()),
                                                                                         new VariationCoefficientLogNormalDistribution
            {
                Mean = (RoundedDouble)0.05,
                CoefficientOfVariation = random.NextRoundedDouble()
            });

            var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(
                new[]
            {
                soilLayer1,
                soilLayer2
            },
                new[]
            {
                preconsolidationStress
            });

            // Call
            SoilProfile soilProfile = SoilProfileConverter.Convert(profile);

            // Assert
            CalculatorInputAssert.AssertSoilProfile(profile, soilProfile);
        }