Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionViewTest.cs =================================================================== diff -u -r11faaf2149d31eb83bcb32b8be0e989b477d3c83 -r89eba1fca653769a3c3f7ebe9da8d91ebf0047a5 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionViewTest.cs (.../AssemblyResultPerSectionViewTest.cs) (revision 11faaf2149d31eb83bcb32b8be0e989b477d3c83) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionViewTest.cs (.../AssemblyResultPerSectionViewTest.cs) (revision 89eba1fca653769a3c3f7ebe9da8d91ebf0047a5) @@ -39,6 +39,7 @@ using Ringtoets.Integration.Data; using Ringtoets.Integration.Forms.Views; using Ringtoets.Integration.TestUtil; +using Ringtoets.MacroStabilityInwards.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.Test.Views @@ -369,8 +370,8 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var calculatorfactory = (TestAssemblyToolCalculatorFactory )AssemblyToolCalculatorFactory.Instance; - AssessmentSectionAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedAssessmentSectionAssemblyCalculator; + var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + AssessmentSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedAssessmentSectionAssemblyCalculator; calculator.ThrowExceptionOnCalculate = withError; using (AssemblyResultPerSectionView view = ShowAssemblyResultPerSectionView(assessmentSection)) @@ -394,6 +395,31 @@ } } + [Test] + public void GivenFormWithAssemblyResultPerSectionViewAndManualAssembly_WhenShown_ThenManualAssemblyUsed() + { + // Given + var random = new Random(21); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllFailureMechanismSectionsAndResults( + random.NextEnumValue()); + MacroStabilityInwardsFailureMechanismSectionResult sectionResult = assessmentSection.MacroStabilityInwards.SectionResults.First(); + sectionResult.UseManualAssemblyProbability = true; + sectionResult.ManualAssemblyProbability = random.NextDouble(); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + + // When + using (ShowAssemblyResultPerSectionView(assessmentSection)) + { + // Then + Assert.AreEqual(sectionResult.ManualAssemblyProbability, calculator.ManualAssemblyProbabilityInput); + } + } + } + private ButtonTester GetRefreshAssemblyResultButtonTester() { return new ButtonTester("refreshAssemblyResultsButton", testForm);