public void ProbabilisticGetInitialFailureMechanismResultProbability_ScenarioWithNaNResults_ReturnsNaN()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double contribution1 = 0.2;
            const double contribution2 = 0.8;

            var pipingCalculationScenario1 =
                ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);
            var pipingCalculationScenario2 =
                ProbabilisticPipingCalculationTestFactory.CreateNotCalculatedCalculation <ProbabilisticPipingCalculationScenario>(section);

            pipingCalculationScenario1.IsRelevant   = true;
            pipingCalculationScenario1.Contribution = (RoundedDouble)contribution1;

            pipingCalculationScenario2.IsRelevant   = true;
            pipingCalculationScenario2.Contribution = (RoundedDouble)contribution2;
            pipingCalculationScenario2.Output       = new ProbabilisticPipingOutput(new TestPartialProbabilisticPipingOutput(double.NaN, null),
                                                                                    new TestPartialProbabilisticPipingOutput(double.NaN, null));

            ProbabilisticPipingCalculationScenario[] calculations =
            {
                pipingCalculationScenario1,
                pipingCalculationScenario2
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(
                calculations, scenario => scenario.Output.ProfileSpecificOutput);

            // Assert
            Assert.IsNaN(initialFailureMechanismResultProbability);
        }
Esempio n. 2
0
        public void GetInitialFailureMechanismResultProbability_MultipleScenarios_ReturnsValueBasedOnRelevantScenarios()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            GrassCoverErosionInwardsCalculationScenario calculationScenario1 = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateGrassCoverErosionInwardsCalculationScenario(section);
            GrassCoverErosionInwardsCalculationScenario calculationScenario2 = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateGrassCoverErosionInwardsCalculationScenario(section);
            GrassCoverErosionInwardsCalculationScenario calculationScenario3 = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateGrassCoverErosionInwardsCalculationScenario(section);

            calculationScenario1.IsRelevant   = true;
            calculationScenario1.Contribution = (RoundedDouble)0.2111;
            calculationScenario1.Output       = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(1.1), null, null);

            calculationScenario2.IsRelevant   = true;
            calculationScenario2.Contribution = (RoundedDouble)0.7889;
            calculationScenario1.Output       = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(2.2), null, null);

            calculationScenario3.IsRelevant = false;

            GrassCoverErosionInwardsCalculationScenario[] calculationScenarios =
            {
                calculationScenario1,
                calculationScenario2,
                calculationScenario3
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(calculationScenarios);

            // Assert
            Assert.AreEqual(0.3973850177700996, initialFailureMechanismResultProbability);
        }
Esempio n. 3
0
        public void AssembleSectionAdoptableWithProfileProbability_WithInputAndUseLengthEffectFalse_SetsInputOnCalculator(
            AdoptableInitialFailureMechanismResultType initialFailureMechanismResultType, bool expectedHasProbabilitySpecified)
        {
            // Setup
            var    random     = new Random(21);
            bool   isRelevant = random.NextBoolean();
            double manualInitialSectionProbability     = random.NextDouble();
            double calculateStrategySectionProbability = random.NextDouble();
            var    furtherAnalysisType       = random.NextEnumValue <FailureMechanismSectionResultFurtherAnalysisType>();
            double refinedSectionProbability = random.NextDouble();

            var  mocks             = new MockRepository();
            var  calculateStrategy = mocks.StrictMock <IFailureMechanismSectionResultCalculateProbabilityStrategy>();
            bool isInitialFailureMechanismResultTypeAdopt = IsInitialFailureMechanismResultTypeAdopt(initialFailureMechanismResultType);

            if (isInitialFailureMechanismResultTypeAdopt)
            {
                calculateStrategy.Expect(cs => cs.CalculateSectionProbability())
                .Return(calculateStrategySectionProbability);
            }

            mocks.ReplayAll();

            var assessmentSection = new AssessmentSectionStub();

            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection())
            {
                IsRelevant = isRelevant,
                InitialFailureMechanismResultType = initialFailureMechanismResultType,
                ManualInitialFailureMechanismResultSectionProbability = manualInitialSectionProbability,
                FurtherAnalysisType       = furtherAnalysisType,
                RefinedSectionProbability = refinedSectionProbability
            };

            using (new AssemblyToolCalculatorFactoryConfig())
            {
                var calculatorFactory = (TestAssemblyToolCalculatorFactory)AssemblyToolCalculatorFactory.Instance;
                FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator;

                // Call
                FailureMechanismSectionAssemblyResultFactory.AssembleSection(
                    sectionResult, assessmentSection, calculateStrategy, false, random.NextDouble());

                // Assert
                FailureMechanismSectionAssemblyInput calculatorInput = calculator.FailureMechanismSectionAssemblyInput;
                FailureMechanismContribution         failureMechanismContribution = assessmentSection.FailureMechanismContribution;
                Assert.AreEqual(failureMechanismContribution.SignalFloodingProbability, calculatorInput.SignalFloodingProbability);
                Assert.AreEqual(failureMechanismContribution.MaximumAllowableFloodingProbability, calculatorInput.MaximumAllowableFloodingProbability);

                Assert.AreEqual(isRelevant, calculatorInput.IsRelevant);
                Assert.AreEqual(expectedHasProbabilitySpecified, calculatorInput.HasProbabilitySpecified);

                double expectedInitialSectionProbability = isInitialFailureMechanismResultTypeAdopt
                                                               ? calculateStrategySectionProbability
                                                               : manualInitialSectionProbability;
                Assert.AreEqual(expectedInitialSectionProbability, calculatorInput.InitialSectionProbability);
                Assert.AreEqual(furtherAnalysisType, calculatorInput.FurtherAnalysisType);
                Assert.AreEqual(refinedSectionProbability, calculatorInput.RefinedSectionProbability);
            }
        }
        public void CalculateProfileProbability_MultipleScenarios_ReturnsValueBasedOnRelevantScenarios()
        {
            // Setup
            FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double factorOfStability1 = 1.0 / 10.0;
            const double factorOfStability2 = 1.0 / 20.0;

            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario1 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(factorOfStability1, section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario2 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(factorOfStability2, section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario3 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateIrrelevantMacroStabilityInwardsCalculationScenario(section);

            macroStabilityInwardsCalculationScenario1.Contribution = (RoundedDouble)0.2111;
            macroStabilityInwardsCalculationScenario2.Contribution = (RoundedDouble)0.7889;

            MacroStabilityInwardsCalculationScenario[] calculations =
            {
                macroStabilityInwardsCalculationScenario1,
                macroStabilityInwardsCalculationScenario2,
                macroStabilityInwardsCalculationScenario3
            };

            var strategy = new MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy(
                sectionResult, calculations, new MacroStabilityInwardsFailureMechanism());

            // Call
            double profileProbability = strategy.CalculateProfileProbability();

            // Assert
            Assert.AreEqual(0.99012835, profileProbability, 1e-8);
        }
        public void ProbabilisticGetInitialFailureMechanismResultProbability_MultipleScenarios_ReturnsValueBasedOnRelevantScenarios()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            var pipingCalculationScenario1 =
                ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);
            var pipingCalculationScenario2 =
                ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);
            var pipingCalculationScenario3 =
                ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);

            pipingCalculationScenario1.IsRelevant   = true;
            pipingCalculationScenario1.Contribution = (RoundedDouble)0.2111;

            pipingCalculationScenario2.IsRelevant   = true;
            pipingCalculationScenario2.Contribution = (RoundedDouble)0.7889;

            pipingCalculationScenario3.IsRelevant = false;

            ProbabilisticPipingCalculationScenario[] calculations =
            {
                pipingCalculationScenario1,
                pipingCalculationScenario2,
                pipingCalculationScenario3
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(
                calculations, scenario => scenario.Output.ProfileSpecificOutput);

            // Assert
            Assert.AreEqual(0.24284668249632746, initialFailureMechanismResultProbability);
        }
        /// <summary>
        /// Creates a new instance of <see cref="SemiProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy"/>.
        /// </summary>
        /// <param name="sectionResult">The <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResult"/> to get the probabilities for.</param>
        /// <param name="calculationScenarios">All the <see cref="SemiProbabilisticPipingCalculationScenario"/> of the failure mechanism. </param>
        /// <param name="failureMechanism">The failure mechanism the calculation scenarios belong to.</param>
        /// <param name="assessmentSection">The assessment section the failure mechanism belongs to.</param>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public SemiProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy(AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
                                                                                                IEnumerable <SemiProbabilisticPipingCalculationScenario> calculationScenarios,
                                                                                                PipingFailureMechanism failureMechanism,
                                                                                                IAssessmentSection assessmentSection)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (calculationScenarios == null)
            {
                throw new ArgumentNullException(nameof(calculationScenarios));
            }

            if (failureMechanism == null)
            {
                throw new ArgumentNullException(nameof(failureMechanism));
            }

            if (assessmentSection == null)
            {
                throw new ArgumentNullException(nameof(assessmentSection));
            }

            this.sectionResult        = sectionResult;
            this.calculationScenarios = calculationScenarios;
            this.failureMechanism     = failureMechanism;
            this.assessmentSection    = assessmentSection;
        }
Esempio n. 7
0
        public void AssembleSectionAdoptableSectionWithProfileProbability_CalculatorRan_ReturnsExpectedOutput()
        {
            // Setup
            var random = new Random(21);

            var mocks             = new MockRepository();
            var calculateStrategy = mocks.Stub <IFailureMechanismSectionResultCalculateProbabilityStrategy>();

            mocks.ReplayAll();

            var assessmentSection = new AssessmentSectionStub();
            var sectionResult     = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection());

            using (new AssemblyToolCalculatorFactoryConfig())
            {
                var calculatorFactory = (TestAssemblyToolCalculatorFactory)AssemblyToolCalculatorFactory.Instance;
                FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator;

                // Call
                FailureMechanismSectionAssemblyResultWrapper result = FailureMechanismSectionAssemblyResultFactory.AssembleSection(
                    sectionResult, assessmentSection, calculateStrategy, random.NextBoolean(), random.NextDouble());

                // Assert
                Assert.AreSame(calculator.FailureMechanismSectionAssemblyResultOutput, result);
            }
        }
Esempio n. 8
0
        private static SemiProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy CreateStrategyForMultipleScenarios(FailureMechanismSection section)
        {
            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            var calculationScenario1 = SemiProbabilisticPipingCalculationTestFactory.CreateCalculation <SemiProbabilisticPipingCalculationScenario>(section);
            var calculationScenario2 = SemiProbabilisticPipingCalculationTestFactory.CreateCalculation <SemiProbabilisticPipingCalculationScenario>(section);
            var calculationScenario3 = SemiProbabilisticPipingCalculationTestFactory.CreateCalculation <SemiProbabilisticPipingCalculationScenario>(section);

            calculationScenario1.IsRelevant   = true;
            calculationScenario1.Contribution = (RoundedDouble)0.2111;
            calculationScenario1.Output       = PipingTestDataGenerator.GetSemiProbabilisticPipingOutput(0.01, 0.02, 0.03);

            calculationScenario2.IsRelevant   = true;
            calculationScenario2.Contribution = (RoundedDouble)0.7889;
            calculationScenario2.Output       = PipingTestDataGenerator.GetSemiProbabilisticPipingOutput(0.04, 0.05, 0.06);

            calculationScenario3.IsRelevant = false;

            SemiProbabilisticPipingCalculationScenario[] calculations =
            {
                calculationScenario1,
                calculationScenario2,
                calculationScenario3
            };

            return(new SemiProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy(
                       sectionResult, calculations, new PipingFailureMechanism(), new AssessmentSectionStub()));
        }
        /// <summary>
        /// Assembles the section based on the input arguments.
        /// </summary>
        /// <param name="sectionResult">The section result to assemble.</param>
        /// <param name="failureMechanism">The <see cref="MacroStabilityInwardsFailureMechanism"/> the section result belongs to.</param>
        /// <param name="assessmentSection">The <see cref="IAssessmentSection"/> the section belongs to.</param>
        /// <returns>A <see cref="FailureMechanismSectionAssemblyResultWrapper"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any argument is <c>null</c>.</exception>
        /// <exception cref="AssemblyException">Thrown when the section could not be assembled.</exception>
        public static FailureMechanismSectionAssemblyResultWrapper AssembleSection(AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
                                                                                   MacroStabilityInwardsFailureMechanism failureMechanism,
                                                                                   IAssessmentSection assessmentSection)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (failureMechanism == null)
            {
                throw new ArgumentNullException(nameof(failureMechanism));
            }

            if (assessmentSection == null)
            {
                throw new ArgumentNullException(nameof(assessmentSection));
            }

            MacroStabilityInwardsCalculationScenario[] calculationScenarios = failureMechanism.Calculations
                                                                              .OfType <MacroStabilityInwardsCalculationScenario>()
                                                                              .ToArray();

            return(FailureMechanismSectionAssemblyResultFactory.AssembleSection(
                       sectionResult, assessmentSection,
                       new MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy(sectionResult, calculationScenarios, failureMechanism),
                       failureMechanism.GeneralInput.ApplyLengthEffectInSection,
                       failureMechanism.MacroStabilityInwardsProbabilityAssessmentInput.GetN(sectionResult.Section.Length)));
        }
        public void GetInitialFailureMechanismResultProbability_MultipleScenarios_ReturnsValueBasedOnRelevantScenarios()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double factorOfStability1 = 1.0 / 10.0;
            const double factorOfStability2 = 1.0 / 20.0;

            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario1 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(factorOfStability1, section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario2 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(factorOfStability2, section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario3 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateIrrelevantMacroStabilityInwardsCalculationScenario(section);

            macroStabilityInwardsCalculationScenario1.Contribution = (RoundedDouble)0.2111;
            macroStabilityInwardsCalculationScenario2.Contribution = (RoundedDouble)0.7889;

            MacroStabilityInwardsCalculationScenario[] calculations =
            {
                macroStabilityInwardsCalculationScenario1,
                macroStabilityInwardsCalculationScenario2,
                macroStabilityInwardsCalculationScenario3
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(calculations, 1.1);

            // Assert
            Assert.AreEqual(0.99052414832077185, initialFailureMechanismResultProbability);
        }
        public void GetInitialFailureMechanismResultProbability_ScenarioWithNaNResults_ReturnsNaN()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double contribution1 = 0.2;
            const double contribution2 = 0.8;

            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario1 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenarioWithNaNOutput(section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario2 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(section);

            macroStabilityInwardsCalculationScenario1.IsRelevant   = true;
            macroStabilityInwardsCalculationScenario1.Contribution = (RoundedDouble)contribution1;

            macroStabilityInwardsCalculationScenario2.IsRelevant   = true;
            macroStabilityInwardsCalculationScenario2.Contribution = (RoundedDouble)contribution2;

            MacroStabilityInwardsCalculationScenario[] calculations =
            {
                macroStabilityInwardsCalculationScenario1,
                macroStabilityInwardsCalculationScenario2
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(calculations, 0.1);

            // Assert
            Assert.IsNaN(initialFailureMechanismResultProbability);
        }
Esempio n. 12
0
        public void GetInitialFailureMechanismResultProbability_ScenarioWithNaNResults_ReturnsNaN()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double contribution1 = 0.2;
            const double contribution2 = 0.8;

            GrassCoverErosionInwardsCalculationScenario calculationScenario1 = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateGrassCoverErosionInwardsCalculationScenario(section);
            GrassCoverErosionInwardsCalculationScenario calculationScenario2 = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateNotCalculatedGrassCoverErosionInwardsCalculationScenario(section);

            calculationScenario1.IsRelevant   = true;
            calculationScenario1.Contribution = (RoundedDouble)contribution1;

            calculationScenario2.IsRelevant   = true;
            calculationScenario2.Contribution = (RoundedDouble)contribution2;
            calculationScenario2.Output       = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(double.NaN), null, null);

            GrassCoverErosionInwardsCalculationScenario[] calculationScenarios =
            {
                calculationScenario1,
                calculationScenario2
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(calculationScenarios);

            // Assert
            Assert.IsNaN(initialFailureMechanismResultProbability);
        }
        public void SemiProbabilisticGetInitialFailureMechanismResultProbability_ScenarioWithNaNResults_ReturnsNaN()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double contribution1 = 0.2;
            const double contribution2 = 0.8;

            var pipingCalculationScenario1 =
                SemiProbabilisticPipingCalculationTestFactory.CreateCalculation <SemiProbabilisticPipingCalculationScenario>(section);
            var pipingCalculationScenario2 =
                SemiProbabilisticPipingCalculationTestFactory.CreateNotCalculatedCalculation <SemiProbabilisticPipingCalculationScenario>(section);

            pipingCalculationScenario1.IsRelevant   = true;
            pipingCalculationScenario1.Contribution = (RoundedDouble)contribution1;

            pipingCalculationScenario2.IsRelevant   = true;
            pipingCalculationScenario2.Contribution = (RoundedDouble)contribution2;
            pipingCalculationScenario2.Output       = new SemiProbabilisticPipingOutput(new SemiProbabilisticPipingOutput.ConstructionProperties());

            SemiProbabilisticPipingCalculationScenario[] calculations =
            {
                pipingCalculationScenario1,
                pipingCalculationScenario2
            };

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(calculations, 0.1);

            // Assert
            Assert.IsNaN(initialFailureMechanismResultProbability);
        }
Esempio n. 14
0
        /// <summary>
        /// Gets the value for the initial failure mechanism result per failure mechanism section as a probability.
        /// </summary>
        /// <param name="sectionResult">The section result to get the initial failure mechanism result probability for.</param>
        /// <param name="calculationScenarios">All semi probabilistic calculation scenarios in the failure mechanism.</param>
        /// <param name="norm">The norm to assess for.</param>
        /// <returns>The calculated initial failure mechanism result probability; or <see cref="double.NaN"/> when there
        /// are no relevant calculations, when not all relevant calculations are performed or when the
        /// contributions of the relevant calculations don't add up to 1.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public static double GetInitialFailureMechanismResultProbability(this AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
                                                                         IEnumerable <SemiProbabilisticPipingCalculationScenario> calculationScenarios,
                                                                         double norm)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (calculationScenarios == null)
            {
                throw new ArgumentNullException(nameof(calculationScenarios));
            }

            SemiProbabilisticPipingCalculationScenario[] relevantScenarios = sectionResult.GetRelevantCalculationScenarios <SemiProbabilisticPipingCalculationScenario>(
                calculationScenarios,
                (scenario, lineSegments) => scenario.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments))
                                                                             .ToArray();

            if (!CalculationScenarioHelper.ScenariosAreValid(relevantScenarios))
            {
                return(double.NaN);
            }

            double totalInitialFailureMechanismResult = 0;

            foreach (SemiProbabilisticPipingCalculationScenario scenario in relevantScenarios)
            {
                DerivedSemiProbabilisticPipingOutput derivedOutput = DerivedSemiProbabilisticPipingOutputFactory.Create(scenario.Output, norm);
                totalInitialFailureMechanismResult += derivedOutput.PipingProbability * (double)scenario.Contribution;
            }

            return(totalInitialFailureMechanismResult);
        }
Esempio n. 15
0
        public void AssembleSectionAdoptableSectionWithProfileProbability_CalculatorThrowsException_ThrowsAssemblyException()
        {
            // Setup
            var random = new Random(21);

            var mocks             = new MockRepository();
            var calculateStrategy = mocks.Stub <IFailureMechanismSectionResultCalculateProbabilityStrategy>();

            mocks.ReplayAll();

            var assessmentSection = new AssessmentSectionStub();
            var sectionResult     = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection());

            using (new AssemblyToolCalculatorFactoryConfig())
            {
                var calculatorFactory = (TestAssemblyToolCalculatorFactory)AssemblyToolCalculatorFactory.Instance;
                FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator;
                calculator.ThrowExceptionOnCalculate = true;

                // Call
                void Call() => FailureMechanismSectionAssemblyResultFactory.AssembleSection(
                    sectionResult, assessmentSection, calculateStrategy, random.NextBoolean(), random.NextDouble());

                // Assert
                var       exception      = Assert.Throws <AssemblyException>(Call);
                Exception innerException = exception.InnerException;
                Assert.IsInstanceOf <FailureMechanismSectionAssemblyCalculatorException>(innerException);
                Assert.AreEqual(innerException.Message, exception.Message);
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Assembles the section based on the input arguments.
        /// </summary>
        /// <param name="sectionResult">The section result to assemble.</param>
        /// <param name="failureMechanism">The <see cref="PipingFailureMechanism"/> the section result belongs to.</param>
        /// <param name="assessmentSection">The <see cref="IAssessmentSection"/> the section belongs to.</param>
        /// <returns>A <see cref="FailureMechanismSectionAssemblyResultWrapper"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any argument is <c>null</c>.</exception>
        /// <exception cref="AssemblyException">Thrown when the section could not be assembled.</exception>
        public static FailureMechanismSectionAssemblyResultWrapper AssembleSection(
            AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
            PipingFailureMechanism failureMechanism,
            IAssessmentSection assessmentSection)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (failureMechanism == null)
            {
                throw new ArgumentNullException(nameof(failureMechanism));
            }

            if (assessmentSection == null)
            {
                throw new ArgumentNullException(nameof(assessmentSection));
            }

            IFailureMechanismSectionResultCalculateProbabilityStrategy calculateProbabilityStrategy =
                PipingFailureMechanismSectionResultCalculateProbabilityStrategyFactory.CreateCalculateStrategy(sectionResult, failureMechanism, assessmentSection);

            return(FailureMechanismSectionAssemblyResultFactory.AssembleSection(
                       sectionResult, assessmentSection, calculateProbabilityStrategy,
                       failureMechanism.GeneralInput.ApplyLengthEffectInSection,
                       failureMechanism.PipingProbabilityAssessmentInput.GetN(sectionResult.Section.Length)));
        }
Esempio n. 17
0
        /// <summary>
        /// Gets the value for the initial failure mechanism result per failure mechanism section as a probability.
        /// </summary>
        /// <param name="sectionResult">The section result to get the initial failure mechanism result probability for.</param>
        /// <param name="calculationScenarios">All probabilistic calculation scenarios in the failure mechanism.</param>
        /// <param name="getOutputFunc">The function to get the output from a calculation scenario.</param>
        /// <returns>The calculated initial failure mechanism result probability; or <see cref="double.NaN"/> when there
        /// are no relevant calculations, when not all relevant calculations are performed or when the
        /// contributions of the relevant calculations don't add up to 1.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public static double GetInitialFailureMechanismResultProbability(this AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
                                                                         IEnumerable <ProbabilisticPipingCalculationScenario> calculationScenarios,
                                                                         Func <ProbabilisticPipingCalculationScenario, IPartialProbabilisticPipingOutput> getOutputFunc)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (calculationScenarios == null)
            {
                throw new ArgumentNullException(nameof(calculationScenarios));
            }

            if (getOutputFunc == null)
            {
                throw new ArgumentNullException(nameof(getOutputFunc));
            }

            ProbabilisticPipingCalculationScenario[] relevantScenarios = sectionResult.GetRelevantCalculationScenarios <ProbabilisticPipingCalculationScenario>(
                calculationScenarios,
                (scenario, lineSegments) => scenario.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments))
                                                                         .ToArray();

            return(CalculationScenarioHelper.ScenariosAreValid(relevantScenarios)
                       ? relevantScenarios.Sum(scenario => StatisticsConverter.ReliabilityToProbability(getOutputFunc(scenario).Reliability) * (double)scenario.Contribution)
                       : double.NaN);
        }
 private static ProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy CreateProbabilisticCalculateStrategy(
     PipingFailureMechanism failureMechanism,
     AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult)
 {
     return(new ProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy(
                sectionResult, failureMechanism.Calculations.OfType <ProbabilisticPipingCalculationScenario>()));
 }
        /// <summary>
        /// Gets the value for the initial failure mechanism result per failure mechanism section as a probability.
        /// </summary>
        /// <param name="sectionResult">The section result to get the initial failure mechanism result probability for.</param>
        /// <param name="calculationScenarios">All probabilistic calculation scenarios in the failure mechanism.</param>
        /// <returns>The calculated initial failure mechanism result probability; or <see cref="double.NaN"/> when there
        /// are no relevant calculations, when not all relevant calculations are performed or when the
        /// contributions of the relevant calculations don't add up to 1.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public static double GetInitialFailureMechanismResultProbability(this AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
                                                                         IEnumerable <GrassCoverErosionInwardsCalculationScenario> calculationScenarios)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (calculationScenarios == null)
            {
                throw new ArgumentNullException(nameof(calculationScenarios));
            }

            GrassCoverErosionInwardsCalculationScenario[] relevantScenarios = sectionResult.GetRelevantCalculationScenarios <GrassCoverErosionInwardsCalculationScenario>(
                calculationScenarios,
                (scenario, lineSegments) => scenario.IsDikeProfileIntersectionWithReferenceLineInSection(lineSegments))
                                                                              .ToArray();

            if (!CalculationScenarioHelper.ScenariosAreValid(relevantScenarios))
            {
                return(double.NaN);
            }

            double totalInitialFailureMechanismResult = 0;

            foreach (GrassCoverErosionInwardsCalculationScenario scenario in relevantScenarios)
            {
                ProbabilityAssessmentOutput derivedOutput = ProbabilityAssessmentOutputFactory.Create(scenario.Output.OvertoppingOutput.Reliability);
                totalInitialFailureMechanismResult += derivedOutput.Probability * (double)scenario.Contribution;
            }

            return(totalInitialFailureMechanismResult);
        }
        public void AssembleSection_CalculatorThrowsException_ThrowsAssemblyException()
        {
            // Setup
            FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            var failureMechanism  = new MacroStabilityInwardsFailureMechanism();
            var assessmentSection = new AssessmentSectionStub();

            using (new AssemblyToolCalculatorFactoryConfig())
            {
                var calculatorFactory = (TestAssemblyToolCalculatorFactory)AssemblyToolCalculatorFactory.Instance;
                FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator;
                calculator.ThrowExceptionOnCalculate = true;

                // Call
                void Call() => MacroStabilityInwardsFailureMechanismAssemblyFactory.AssembleSection(
                    sectionResult, failureMechanism, assessmentSection);

                // Assert
                var       exception      = Assert.Throws <AssemblyException>(Call);
                Exception innerException = exception.InnerException;
                Assert.IsInstanceOf <FailureMechanismSectionAssemblyCalculatorException>(innerException);
                Assert.AreEqual(innerException.Message, exception.Message);
            }
        }
        public void CalculateProfileProbability_MultipleScenarios_ReturnsValueBasedOnRelevantScenarios()
        {
            // Setup
            FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            var calculationScenario1 = ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);
            var calculationScenario2 = ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);
            var calculationScenario3 = ProbabilisticPipingCalculationTestFactory.CreateCalculation <ProbabilisticPipingCalculationScenario>(section);

            calculationScenario1.IsRelevant   = true;
            calculationScenario1.Contribution = (RoundedDouble)0.2111;

            calculationScenario2.IsRelevant   = true;
            calculationScenario2.Contribution = (RoundedDouble)0.7889;

            calculationScenario3.IsRelevant = false;

            ProbabilisticPipingCalculationScenario[] calculations =
            {
                calculationScenario1,
                calculationScenario2,
                calculationScenario3
            };

            var strategy = new ProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy(sectionResult, calculations);

            // Call
            double profileProbability = strategy.CalculateProfileProbability();

            // Assert
            Assert.AreEqual(0.24284668249632746, profileProbability);
        }
        private static MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy CreateStrategyForMultipleScenarios(FailureMechanismSection section)
        {
            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            const double factorOfStability1 = 1.0 / 10.0;
            const double factorOfStability2 = 1.0 / 20.0;

            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario1 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(factorOfStability1, section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario2 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(factorOfStability2, section);
            MacroStabilityInwardsCalculationScenario macroStabilityInwardsCalculationScenario3 =
                MacroStabilityInwardsCalculationScenarioTestFactory.CreateIrrelevantMacroStabilityInwardsCalculationScenario(section);

            macroStabilityInwardsCalculationScenario1.Contribution = (RoundedDouble)0.2111;
            macroStabilityInwardsCalculationScenario2.Contribution = (RoundedDouble)0.7889;

            MacroStabilityInwardsCalculationScenario[] calculations =
            {
                macroStabilityInwardsCalculationScenario1,
                macroStabilityInwardsCalculationScenario2,
                macroStabilityInwardsCalculationScenario3
            };

            return(new MacroStabilityInwardsFailureMechanismSectionResultCalculateProbabilityStrategy(
                       sectionResult, calculations, new MacroStabilityInwardsFailureMechanism()));
        }
 private static SemiProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy CreateSemiProbabilisticCalculateStrategy(
     PipingFailureMechanism failureMechanism,
     AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
     IAssessmentSection assessmentSection)
 {
     return(new SemiProbabilisticPipingFailureMechanismSectionResultCalculateProbabilityStrategy(
                sectionResult, failureMechanism.Calculations.OfType <SemiProbabilisticPipingCalculationScenario>(),
                failureMechanism, assessmentSection));
 }
Esempio n. 24
0
        public void AssembleSectionAdoptableWithProfileProbability_WithInputAndUseLengthEffectTrueAndVariousProbabilityRefinementType_SetsInputOnCalculator(
            ProbabilityRefinementType probabilityRefinementType,
            double sectionN)
        {
            // Setup
            var    random = new Random(21);
            double refinedSectionProbability = random.NextDouble();
            double refinedProfileProbability = random.NextDouble();

            var mocks             = new MockRepository();
            var calculateStrategy = mocks.Stub <IFailureMechanismSectionResultCalculateProbabilityStrategy>();

            mocks.ReplayAll();

            var assessmentSection = new AssessmentSectionStub();

            var sectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection())
            {
                ProbabilityRefinementType = probabilityRefinementType,
                RefinedProfileProbability = refinedProfileProbability,
                RefinedSectionProbability = refinedSectionProbability
            };

            using (new AssemblyToolCalculatorFactoryConfig())
            {
                var calculatorFactory = (TestAssemblyToolCalculatorFactory)AssemblyToolCalculatorFactory.Instance;
                FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator;

                // Call
                FailureMechanismSectionAssemblyResultFactory.AssembleSection(
                    sectionResult, assessmentSection, calculateStrategy, true, sectionN);

                // Assert
                FailureMechanismSectionWithProfileProbabilityAssemblyInput calculatorInput = calculator.FailureMechanismSectionWithProfileProbabilityAssemblyInput;
                switch (probabilityRefinementType)
                {
                case ProbabilityRefinementType.Profile:
                    Assert.AreEqual(refinedProfileProbability, calculatorInput.RefinedProfileProbability);
                    Assert.AreEqual(Math.Min(1.0, refinedProfileProbability * sectionN), calculatorInput.RefinedSectionProbability);
                    break;

                case ProbabilityRefinementType.Section:
                    Assert.AreEqual(refinedSectionProbability / sectionN, calculatorInput.RefinedProfileProbability);
                    Assert.AreEqual(refinedSectionProbability, calculatorInput.RefinedSectionProbability);
                    break;

                case ProbabilityRefinementType.Both:
                    Assert.AreEqual(refinedProfileProbability, calculatorInput.RefinedProfileProbability);
                    Assert.AreEqual(refinedSectionProbability, calculatorInput.RefinedSectionProbability);
                    break;
                }
            }
        }
        public void SemiProbabilisticGetInitialFailureMechanismResultProbability_NoScenarios_ReturnsNaN()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(Enumerable.Empty <SemiProbabilisticPipingCalculationScenario>(), 0.1);

            // Assert
            Assert.IsNaN(initialFailureMechanismResultProbability);
        }
Esempio n. 26
0
        public void ManualInitialFailureMechanismResultProfileProbability_ValidValue_NewValueSet(double newValue)
        {
            // Setup
            FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            // Call
            result.ManualInitialFailureMechanismResultProfileProbability = newValue;

            // Assert
            Assert.AreEqual(newValue, result.ManualInitialFailureMechanismResultProfileProbability);
        }
Esempio n. 27
0
        public void GetInitialFailureMechanismResultProbability_NoScenarios_ReturnsNaN()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            // Call
            double initialFailureMechanismResultProbability = failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(
                Enumerable.Empty <GrassCoverErosionInwardsCalculationScenario>());

            // Assert
            Assert.IsNaN(initialFailureMechanismResultProbability);
        }
Esempio n. 28
0
        /// <summary>
        /// Asserts whether the data of the <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResultEntity"/> and
        /// <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResult"/> have equal values.
        /// </summary>
        /// <param name="sectionResultEntity">The <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResultEntity"/>.</param>
        /// <param name="sectionResult">The <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResult"/>.</param>
        public static void AssertSectionResult(AdoptableWithProfileProbabilityFailureMechanismSectionResultEntity sectionResultEntity,
                                               AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult)
        {
            Assert.AreEqual(Convert.ToBoolean(sectionResultEntity.IsRelevant), sectionResult.IsRelevant);
            Assert.AreEqual((AdoptableInitialFailureMechanismResultType)sectionResultEntity.InitialFailureMechanismResultType, sectionResult.InitialFailureMechanismResultType);
            Assert.AreEqual(sectionResultEntity.ManualInitialFailureMechanismResultSectionProbability.ToNullAsNaN(), sectionResult.ManualInitialFailureMechanismResultSectionProbability);
            Assert.AreEqual((FailureMechanismSectionResultFurtherAnalysisType)sectionResultEntity.FurtherAnalysisType, sectionResult.FurtherAnalysisType);
            Assert.AreEqual(sectionResultEntity.RefinedSectionProbability.ToNullAsNaN(), sectionResult.RefinedSectionProbability);

            Assert.AreEqual(sectionResultEntity.ManualInitialFailureMechanismResultProfileProbability.ToNullAsNaN(), sectionResult.ManualInitialFailureMechanismResultProfileProbability);
            Assert.AreEqual((ProbabilityRefinementType)sectionResultEntity.ProbabilityRefinementType, sectionResult.ProbabilityRefinementType);
            Assert.AreEqual(sectionResultEntity.RefinedProfileProbability.ToNullAsNaN(), sectionResult.RefinedProfileProbability);
        }
        /// <summary>
        /// Assembles a failure mechanism section result based on the input arguments.
        /// </summary>
        /// <param name="sectionResult">The section result to assemble for.</param>
        /// <param name="assessmentSection">The <see cref="IAssessmentSection"/> to assemble with.</param>
        /// <param name="calculateProbabilityStrategy">The <see cref="IFailureMechanismSectionResultCalculateProbabilityStrategy"/>
        /// to assemble with.</param>
        /// <param name="useLengthEffect">Indicator whether to use the length effect or not.</param>
        /// <param name="sectionN">The N value for the section.</param>
        /// <returns>A <see cref="FailureMechanismSectionAssemblyResultWrapper"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="sectionResult"/>,
        /// <paramref name="assessmentSection"/> or <paramref name="calculateProbabilityStrategy"/> is <c>null</c>.</exception>
        /// <exception cref="AssemblyException">Thrown when the section could not be successfully assembled.</exception>
        public static FailureMechanismSectionAssemblyResultWrapper AssembleSection(
            AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult, IAssessmentSection assessmentSection,
            IFailureMechanismSectionResultCalculateProbabilityStrategy calculateProbabilityStrategy,
            bool useLengthEffect, double sectionN)
        {
            if (sectionResult == null)
            {
                throw new ArgumentNullException(nameof(sectionResult));
            }

            if (assessmentSection == null)
            {
                throw new ArgumentNullException(nameof(assessmentSection));
            }

            if (calculateProbabilityStrategy == null)
            {
                throw new ArgumentNullException(nameof(calculateProbabilityStrategy));
            }

            bool   isInitialFailureMechanismResultTypeAdopt        = sectionResult.InitialFailureMechanismResultType == AdoptableInitialFailureMechanismResultType.Adopt;
            double initialFailureMechanismResultSectionProbability =
                isInitialFailureMechanismResultTypeAdopt
                    ? calculateProbabilityStrategy.CalculateSectionProbability()
                    : sectionResult.ManualInitialFailureMechanismResultSectionProbability;

            FailureMechanismSectionAssemblyInput input;

            if (useLengthEffect)
            {
                double initialFailureMechanismResultProfileProbability =
                    isInitialFailureMechanismResultTypeAdopt
                        ? calculateProbabilityStrategy.CalculateProfileProbability()
                        : sectionResult.ManualInitialFailureMechanismResultProfileProbability;

                input = CreateInput(
                    assessmentSection, sectionResult.IsRelevant, sectionResult.InitialFailureMechanismResultType,
                    initialFailureMechanismResultProfileProbability, initialFailureMechanismResultSectionProbability, sectionResult.FurtherAnalysisType,
                    sectionResult.RefinedProfileProbability, sectionResult.RefinedSectionProbability, sectionResult.ProbabilityRefinementType, sectionN);
            }
            else
            {
                bool hasProbabilitySpecified = sectionResult.InitialFailureMechanismResultType != AdoptableInitialFailureMechanismResultType.NoFailureProbability;

                input = CreateInput(
                    assessmentSection, sectionResult.IsRelevant, initialFailureMechanismResultSectionProbability,
                    sectionResult.FurtherAnalysisType, sectionResult.RefinedSectionProbability, hasProbabilitySpecified);
            }

            return(PerformAssembly(input));
        }
Esempio n. 30
0
        public void GetInitialFailureMechanismResultProbability_CalculationScenariosNull_ThrowsArgumentNullException()
        {
            // Setup
            FailureMechanismSection section   = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
            var failureMechanismSectionResult = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section);

            // Call
            void Call() => failureMechanismSectionResult.GetInitialFailureMechanismResultProbability(null);

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

            Assert.AreEqual("calculationScenarios", exception.ParamName);
        }