Index: Riskeer/Common/src/Riskeer.Common.Data/AssemblyTool/FailureMechanismSectionAssemblyResultFactory.cs =================================================================== diff -u -r6a448aca43aee6e9ee31fbaef4f6421d49cbb871 -rc21286c9d5b44af209d059015c1a480e873d2da7 --- Riskeer/Common/src/Riskeer.Common.Data/AssemblyTool/FailureMechanismSectionAssemblyResultFactory.cs (.../FailureMechanismSectionAssemblyResultFactory.cs) (revision 6a448aca43aee6e9ee31fbaef4f6421d49cbb871) +++ Riskeer/Common/src/Riskeer.Common.Data/AssemblyTool/FailureMechanismSectionAssemblyResultFactory.cs (.../FailureMechanismSectionAssemblyResultFactory.cs) (revision c21286c9d5b44af209d059015c1a480e873d2da7) @@ -236,7 +236,7 @@ { if (probabilityRefinementType == ProbabilityRefinementType.Profile) { - refinedSectionProbability = refinedProfileProbability * sectionN; + refinedSectionProbability = Math.Min(1.0, refinedProfileProbability * sectionN); } if (probabilityRefinementType == ProbabilityRefinementType.Section) Index: Riskeer/Common/test/Riskeer.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssemblyResultFactoryTest.cs =================================================================== diff -u -rec2c838182ed237b3abd753347a861857129331b -rc21286c9d5b44af209d059015c1a480e873d2da7 --- Riskeer/Common/test/Riskeer.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssemblyResultFactoryTest.cs (.../FailureMechanismSectionAssemblyResultFactoryTest.cs) (revision ec2c838182ed237b3abd753347a861857129331b) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssemblyResultFactoryTest.cs (.../FailureMechanismSectionAssemblyResultFactoryTest.cs) (revision c21286c9d5b44af209d059015c1a480e873d2da7) @@ -258,17 +258,20 @@ } [Test] - [TestCase(ProbabilityRefinementType.Profile)] - [TestCase(ProbabilityRefinementType.Section)] - [TestCase(ProbabilityRefinementType.Both)] + [TestCase(ProbabilityRefinementType.Profile, 1)] + [TestCase(ProbabilityRefinementType.Profile, 10)] + [TestCase(ProbabilityRefinementType.Section, 1)] + [TestCase(ProbabilityRefinementType.Section, 10)] + [TestCase(ProbabilityRefinementType.Both, 1)] + [TestCase(ProbabilityRefinementType.Both, 10)] public void AssembleSectionAdoptableWithProfileProbability_WithInputAndUseLengthEffectTrueAndVariousProbabilityRefinementType_SetsInputOnCalculator( - ProbabilityRefinementType probabilityRefinementType) + ProbabilityRefinementType probabilityRefinementType, + double sectionN) { // Setup var random = new Random(21); double refinedSectionProbability = random.NextDouble(); double refinedProfileProbability = random.NextDouble(); - double sectionN = random.NextDouble(); var mocks = new MockRepository(); var calculateStrategy = mocks.Stub(); @@ -298,7 +301,7 @@ { case ProbabilityRefinementType.Profile: Assert.AreEqual(refinedProfileProbability, calculatorInput.RefinedProfileProbability); - Assert.AreEqual(refinedProfileProbability * sectionN, calculatorInput.RefinedSectionProbability); + Assert.AreEqual(Math.Min(1.0, refinedProfileProbability * sectionN), calculatorInput.RefinedSectionProbability); break; case ProbabilityRefinementType.Section: Assert.AreEqual(refinedSectionProbability / sectionN, calculatorInput.RefinedProfileProbability);