Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.cs =================================================================== diff -u -r712e462c20fd4a4b41cdc7df9731b6b50789909d -rb2a84d4ad12dde705c07722ef9c264b268bec879 --- Riskeer/Common/src/Riskeer.Common.Forms/Views/AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.cs (.../AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.cs) (revision 712e462c20fd4a4b41cdc7df9731b6b50789909d) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.cs (.../AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.cs) (revision b2a84d4ad12dde705c07722ef9c264b268bec879) @@ -52,7 +52,7 @@ private readonly IFailureMechanismSectionResultCalculateProbabilityStrategy calculateProbabilityStrategy; private readonly IInitialFailureMechanismResultErrorProvider initialFailureMechanismResultErrorProvider; - private readonly Func getNFunc; + private readonly ILengthEffectProvider lengthEffectProvider; private readonly IAssessmentSection assessmentSection; /// @@ -63,15 +63,15 @@ /// The strategy used to calculate probabilities. /// The error provider to use for /// the initial failure mechanism result. - /// The to get the N. + /// The provider to get the length effect properties. /// The assessment section the section result belongs to. /// The property values required to create an instance of /// . /// Throw when any parameter is null. public AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult, IFailureMechanismSectionResultCalculateProbabilityStrategy calculateProbabilityStrategy, IInitialFailureMechanismResultErrorProvider initialFailureMechanismResultErrorProvider, - Func getNFunc, + ILengthEffectProvider lengthEffectProvider, IAssessmentSection assessmentSection, ConstructionProperties constructionProperties) : base(sectionResult) @@ -86,9 +86,9 @@ throw new ArgumentNullException(nameof(initialFailureMechanismResultErrorProvider)); } - if (getNFunc == null) + if (lengthEffectProvider == null) { - throw new ArgumentNullException(nameof(getNFunc)); + throw new ArgumentNullException(nameof(lengthEffectProvider)); } if (assessmentSection == null) @@ -103,7 +103,7 @@ this.calculateProbabilityStrategy = calculateProbabilityStrategy; this.initialFailureMechanismResultErrorProvider = initialFailureMechanismResultErrorProvider; - this.getNFunc = getNFunc; + this.lengthEffectProvider = lengthEffectProvider; this.assessmentSection = assessmentSection; initialFailureMechanismResultIndex = constructionProperties.InitialFailureMechanismResultIndex; @@ -308,7 +308,7 @@ assessmentSection, IsRelevant, InitialFailureMechanismResult, InitialFailureMechanismResultProfileProbability, InitialFailureMechanismResultSectionProbability, FurtherAnalysisNeeded, SectionResult.RefinedProfileProbability, SectionResult.RefinedSectionProbability, - ProbabilityRefinementType, getNFunc()); + ProbabilityRefinementType, lengthEffectProvider.SectionN); } catch (AssemblyException e) { Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/AdoptableWithProfileProbabilityFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r712e462c20fd4a4b41cdc7df9731b6b50789909d -rb2a84d4ad12dde705c07722ef9c264b268bec879 --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/AdoptableWithProfileProbabilityFailureMechanismSectionResultRowTest.cs (.../AdoptableWithProfileProbabilityFailureMechanismSectionResultRowTest.cs) (revision 712e462c20fd4a4b41cdc7df9731b6b50789909d) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/AdoptableWithProfileProbabilityFailureMechanismSectionResultRowTest.cs (.../AdoptableWithProfileProbabilityFailureMechanismSectionResultRowTest.cs) (revision b2a84d4ad12dde705c07722ef9c264b268bec879) @@ -69,14 +69,15 @@ // Setup var mocks = new MockRepository(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); var assessmentSection = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section); // Call - void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, null, errorProvider, () => double.NaN, assessmentSection, ConstructionProperties); + void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, null, errorProvider, lengthEffectProvider, assessmentSection, ConstructionProperties); // Assert var exception = Assert.Throws(Call); @@ -90,14 +91,15 @@ // Setup var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); var assessmentSection = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section); // Call - void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, null, () => double.NaN, assessmentSection, ConstructionProperties); + void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, null, lengthEffectProvider, assessmentSection, ConstructionProperties); // Assert var exception = Assert.Throws(Call); @@ -106,7 +108,7 @@ } [Test] - public void Constructor_GetNFuncNull_ThrowsArgumentNullException() + public void Constructor_LengthEffectProviderNull_ThrowsArgumentNullException() { // Setup var mocks = new MockRepository(); @@ -123,7 +125,7 @@ // Assert var exception = Assert.Throws(Call); - Assert.AreEqual("getNFunc", exception.ParamName); + Assert.AreEqual("lengthEffectProvider", exception.ParamName); mocks.VerifyAll(); } @@ -134,13 +136,14 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section); // Call - void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, null, ConstructionProperties); + void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, null, ConstructionProperties); // Assert var exception = Assert.Throws(Call); @@ -155,14 +158,15 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); var assessmentSection = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section); // Call - void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, assessmentSection, null); + void Call() => new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, assessmentSection, null); // Assert var exception = Assert.Throws(Call); @@ -182,6 +186,7 @@ calculateStrategy.Stub(c => c.CalculateProfileProbability()).Return(profileProbability); calculateStrategy.Stub(c => c.CalculateSectionProbability()).Return(sectionProbability); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -193,7 +198,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert Assert.IsInstanceOf>(row); @@ -254,14 +259,15 @@ calculateStrategy.Stub(c => c.CalculateProfileProbability()).Return(profileProbability); calculateStrategy.Stub(c => c.CalculateSectionProbability()).Return(sectionProbability); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section); using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Precondition Assert.AreEqual(profileProbability, row.InitialFailureMechanismResultProfileProbability); @@ -287,6 +293,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -297,7 +304,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Precondition Assert.AreEqual(result.RefinedProfileProbability, row.RefinedProfileProbability); @@ -326,6 +333,7 @@ .IgnoreArguments() .Return(errorText) .Repeat.Twice(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -334,7 +342,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // When - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Then IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -359,6 +367,7 @@ errorProvider.Stub(ep => ep.GetProbabilityValidationError(null)) .IgnoreArguments() .Return("error message"); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -371,7 +380,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // When - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Then IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -505,6 +514,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); var observer = mocks.StrictMock(); observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); @@ -515,7 +525,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Call setPropertyAction(row); @@ -534,14 +544,15 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var result = new AdoptableWithProfileProbabilityFailureMechanismSectionResult(section); using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Call void Call() => setPropertyAction(row); @@ -571,6 +582,8 @@ calculateStrategy.Stub(c => c.CalculateProfileProbability()).Return(initialProfileProbability); calculateStrategy.Stub(c => c.CalculateSectionProbability()).Return(initialSectionProbability); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); + lengthEffectProvider.Stub(lep => lep.SectionN).Return(n); mocks.ReplayAll(); var assessmentSection = new AssessmentSectionStub(); @@ -588,7 +601,7 @@ FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => n, assessmentSection, ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, assessmentSection, ConstructionProperties); // Assert FailureMechanismSectionAssemblyInput input = calculator.FailureMechanismSectionAssemblyInput; @@ -615,6 +628,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -628,7 +642,7 @@ random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextEnumValue()); // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert FailureMechanismSectionAssemblyResult calculatorOutput = calculator.FailureMechanismSectionAssemblyResultOutput; @@ -654,6 +668,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -666,7 +681,7 @@ calculator.FailureMechanismSectionAssemblyResultOutput = new FailureMechanismSectionAssemblyResult( random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextEnumValue()); - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Precondition FailureMechanismSectionAssemblyResult calculatorOutput = calculator.FailureMechanismSectionAssemblyResultOutput; @@ -690,6 +705,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -700,7 +716,7 @@ var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Precondition IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -732,6 +748,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -743,7 +760,7 @@ FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; calculator.ThrowExceptionOnCalculate = true; - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Precondition IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -788,6 +805,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -796,7 +814,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -821,6 +839,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -835,7 +854,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -873,6 +892,7 @@ errorProvider.Stub(ep => ep.GetProbabilityValidationError(null)) .IgnoreArguments() .Return(string.Empty); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -884,7 +904,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -907,6 +927,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -919,7 +940,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -947,6 +968,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -959,7 +981,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert IDictionary columnStateDefinitions = row.ColumnStateDefinitions; @@ -982,6 +1004,7 @@ var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); var errorProvider = mocks.Stub(); + var lengthEffectProvider = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -994,7 +1017,7 @@ calculator.FailureMechanismSectionAssemblyResultOutput = new FailureMechanismSectionAssemblyResult(double.NaN, double.NaN, double.NaN, assemblyGroup); // Call - var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, () => double.NaN, new AssessmentSectionStub(), ConstructionProperties); + var row = new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(result, calculateStrategy, errorProvider, lengthEffectProvider, new AssessmentSectionStub(), ConstructionProperties); // Assert IDictionary columnStateDefinitions = row.ColumnStateDefinitions; Index: Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs =================================================================== diff -u -r712e462c20fd4a4b41cdc7df9731b6b50789909d -rb2a84d4ad12dde705c07722ef9c264b268bec879 --- Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs (.../GrassCoverErosionInwardsFailureMechanismResultView.cs) (revision 712e462c20fd4a4b41cdc7df9731b6b50789909d) +++ Riskeer/GrassCoverErosionInwards/src/Riskeer.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismResultView.cs (.../GrassCoverErosionInwardsFailureMechanismResultView.cs) (revision b2a84d4ad12dde705c07722ef9c264b268bec879) @@ -104,7 +104,7 @@ sectionResult, CreateCalculateStrategy(sectionResult, calculationScenarios), CreateErrorProvider(sectionResult, calculationScenarios), - () => FailureMechanism.GeneralInput.N, + CreateLengthEffectProvider(), assessmentSection, new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.ConstructionProperties { @@ -205,5 +205,12 @@ sectionResult, calculationScenarios, (scenario, lineSegments) => scenario.IsDikeProfileIntersectionWithReferenceLineInSection(lineSegments)); } + + private ILengthEffectProvider CreateLengthEffectProvider() + { + return new LengthEffectProvider( + () => FailureMechanism.GeneralInput.ApplyLengthEffectInSection, + () => FailureMechanism.GeneralInput.N); + } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismResultView.cs =================================================================== diff -u -r712e462c20fd4a4b41cdc7df9731b6b50789909d -rb2a84d4ad12dde705c07722ef9c264b268bec879 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismResultView.cs (.../MacroStabilityInwardsFailureMechanismResultView.cs) (revision 712e462c20fd4a4b41cdc7df9731b6b50789909d) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismResultView.cs (.../MacroStabilityInwardsFailureMechanismResultView.cs) (revision b2a84d4ad12dde705c07722ef9c264b268bec879) @@ -103,7 +103,7 @@ sectionResult, CreateCalculateStrategy(sectionResult, calculationScenarios), CreateErrorProvider(sectionResult, calculationScenarios), - () => FailureMechanism.MacroStabilityInwardsProbabilityAssessmentInput.GetN(sectionResult.Section.Length), + CreateLengthEffectProvider(sectionResult), assessmentSection, new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.ConstructionProperties { @@ -203,5 +203,12 @@ return new InitialFailureMechanismResultErrorProvider( sectionResult, calculationScenarios, (scenario, lineSegments) => scenario.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments)); } + + private ILengthEffectProvider CreateLengthEffectProvider(IFailureMechanismSectionResult sectionResult) + { + return new LengthEffectProvider( + () => FailureMechanism.GeneralInput.ApplyLengthEffectInSection, + () => FailureMechanism.MacroStabilityInwardsProbabilityAssessmentInput.GetN(sectionResult.Section.Length)); + } } } \ No newline at end of file Index: Riskeer/Piping/src/Riskeer.Piping.Forms/Views/PipingFailureMechanismResultView.cs =================================================================== diff -u -r712e462c20fd4a4b41cdc7df9731b6b50789909d -rb2a84d4ad12dde705c07722ef9c264b268bec879 --- Riskeer/Piping/src/Riskeer.Piping.Forms/Views/PipingFailureMechanismResultView.cs (.../PipingFailureMechanismResultView.cs) (revision 712e462c20fd4a4b41cdc7df9731b6b50789909d) +++ Riskeer/Piping/src/Riskeer.Piping.Forms/Views/PipingFailureMechanismResultView.cs (.../PipingFailureMechanismResultView.cs) (revision b2a84d4ad12dde705c07722ef9c264b268bec879) @@ -126,7 +126,7 @@ sectionResult, CreateCalculateStrategy(sectionResult, scenarioConfigurationForSection), CreateErrorProvider(sectionResult, scenarioConfigurationForSection), - () => FailureMechanism.PipingProbabilityAssessmentInput.GetN(sectionResult.Section.Length), + CreateLengthEffectProvider(sectionResult), assessmentSection, new AdoptableWithProfileProbabilityFailureMechanismSectionResultRow.ConstructionProperties { @@ -245,5 +245,12 @@ || FailureMechanism.ScenarioConfigurationType == PipingScenarioConfigurationType.PerFailureMechanismSection && scenarioConfigurationForSection.ScenarioConfigurationType == PipingScenarioConfigurationPerFailureMechanismSectionType.SemiProbabilistic; } + + private ILengthEffectProvider CreateLengthEffectProvider(IFailureMechanismSectionResult sectionResult) + { + return new LengthEffectProvider( + () => FailureMechanism.GeneralInput.ApplyLengthEffectInSection, + () => FailureMechanism.PipingProbabilityAssessmentInput.GetN(sectionResult.Section.Length)); + } } } \ No newline at end of file