Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs =================================================================== diff -u -r13ab4c5fafdcfb9c5afea05fb49c09e9ae4ffb1f -rebbcd9817094c6e362f9b72067cd0531b967e652 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs (.../WaterPressureAsphaltCoverSectionResultRow.cs) (revision 13ab4c5fafdcfb9c5afea05fb49c09e9ae4ffb1f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs (.../WaterPressureAsphaltCoverSectionResultRow.cs) (revision ebbcd9817094c6e362f9b72067cd0531b967e652) @@ -45,10 +45,18 @@ /// /// The to wrap /// so that it can be displayed as a row. - /// Thrown when is null. - public WaterPressureAsphaltCoverSectionResultRow(WaterPressureAsphaltCoverFailureMechanismSectionResult sectionResult) + /// The property values required to create an instance of + /// . + /// Thrown when any parameter is null. + public WaterPressureAsphaltCoverSectionResultRow(WaterPressureAsphaltCoverFailureMechanismSectionResult sectionResult, + ConstructionProperties constructionProperties) : base(sectionResult) { + if (constructionProperties == null) + { + throw new ArgumentNullException(nameof(constructionProperties)); + } + Update(); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/WaterPressureAsphaltCoverResultView.cs =================================================================== diff -u -r2afbe44f27c31cd98c458a5b0fd137c713178ecd -rebbcd9817094c6e362f9b72067cd0531b967e652 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/WaterPressureAsphaltCoverResultView.cs (.../WaterPressureAsphaltCoverResultView.cs) (revision 2afbe44f27c31cd98c458a5b0fd137c713178ecd) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/WaterPressureAsphaltCoverResultView.cs (.../WaterPressureAsphaltCoverResultView.cs) (revision ebbcd9817094c6e362f9b72067cd0531b967e652) @@ -34,6 +34,13 @@ public class WaterPressureAsphaltCoverResultView : FailureMechanismResultView { + private const int simpleAssessmentResultIndex = 1; + private const int tailorMadeAssessmentResultIndex = 2; + private const int simpleAssemblyCategoryGroupIndex = 3; + private const int tailorMadeAssemblyCategoryGroupIndex = 4; + private const int combinedAssemblyCategoryGroupIndex = 5; + private const int manualAssemblyCategoryGroupIndex = 7; + /// /// /// Creates a new instance of . @@ -45,7 +52,17 @@ protected override WaterPressureAsphaltCoverSectionResultRow CreateFailureMechanismSectionResultRow(WaterPressureAsphaltCoverFailureMechanismSectionResult sectionResult) { - return new WaterPressureAsphaltCoverSectionResultRow(sectionResult); + return new WaterPressureAsphaltCoverSectionResultRow( + sectionResult, + new WaterPressureAsphaltCoverSectionResultRow.ConstructionProperties + { + SimpleAssessmentResultIndex = simpleAssessmentResultIndex, + TailorMadeAssessmentResultIndex = tailorMadeAssessmentResultIndex, + SimpleAssemblyCategoryGroupIndex = simpleAssemblyCategoryGroupIndex, + TailorMadeAssemblyCategoryGroupIndex = tailorMadeAssemblyCategoryGroupIndex, + CombinedAssemblyCategoryGroupIndex = combinedAssemblyCategoryGroupIndex, + ManualAssemblyCategoryGroupIndex = manualAssemblyCategoryGroupIndex + }); } protected override void AddDataGridColumns() Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRowTest.cs =================================================================== diff -u -r7fbcbb35e06c7ff45011ed1dda6a2b7ad762c205 -rebbcd9817094c6e362f9b72067cd0531b967e652 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRowTest.cs (.../WaterPressureAsphaltCoverSectionResultRowTest.cs) (revision 7fbcbb35e06c7ff45011ed1dda6a2b7ad762c205) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRowTest.cs (.../WaterPressureAsphaltCoverSectionResultRowTest.cs) (revision ebbcd9817094c6e362f9b72067cd0531b967e652) @@ -42,7 +42,38 @@ [TestFixture] public class WaterPressureAsphaltCoverSectionResultRowTest { + private static WaterPressureAsphaltCoverSectionResultRow.ConstructionProperties ConstructionProperties + { + get + { + return new WaterPressureAsphaltCoverSectionResultRow.ConstructionProperties + { + SimpleAssessmentResultIndex = 1, + TailorMadeAssessmentResultIndex = 2, + SimpleAssemblyCategoryGroupIndex = 3, + TailorMadeAssemblyCategoryGroupIndex = 4, + CombinedAssemblyCategoryGroupIndex = 5, + ManualAssemblyCategoryGroupIndex = 7 + }; + } + } + [Test] + public void Constructor_ConstructionPropertiesNull_ThrowsArgumentNullException() + { + // Setup + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var result = new WaterPressureAsphaltCoverFailureMechanismSectionResult(section); + + // Call + TestDelegate test = () => new WaterPressureAsphaltCoverSectionResultRow(result, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("constructionProperties", exception.ParamName); + } + + [Test] public void Constructor_WithParameters_ExpectedValues() { // Setup @@ -52,7 +83,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new WaterPressureAsphaltCoverSectionResultRow(result); + var row = new WaterPressureAsphaltCoverSectionResultRow(result, ConstructionProperties); // Assert Assert.IsInstanceOf>(row); @@ -83,7 +114,7 @@ calculator.CombinedAssemblyCategoryOutput = random.NextEnumValue(); // Call - var row = new WaterPressureAsphaltCoverSectionResultRow(result); + var row = new WaterPressureAsphaltCoverSectionResultRow(result, ConstructionProperties); // Assert Assert.AreEqual(FailureMechanismSectionResultRowHelper.GetCategoryGroupDisplayname(calculator.SimpleAssessmentAssemblyOutput.Group), @@ -112,7 +143,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new WaterPressureAsphaltCoverSectionResultRow(result); + var row = new WaterPressureAsphaltCoverSectionResultRow(result, ConstructionProperties); // Precondition Assert.IsFalse(result.UseManualAssemblyCategoryGroup); @@ -144,7 +175,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new WaterPressureAsphaltCoverSectionResultRow(result); + var row = new WaterPressureAsphaltCoverSectionResultRow(result, ConstructionProperties); // Call row.ManualAssemblyCategoryGroup = newValue; @@ -176,7 +207,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new WaterPressureAsphaltCoverSectionResultRow(result); + var row = new WaterPressureAsphaltCoverSectionResultRow(result, ConstructionProperties); // Call row.SimpleAssessmentResult = newValue; @@ -205,7 +236,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new WaterPressureAsphaltCoverSectionResultRow(result); + var row = new WaterPressureAsphaltCoverSectionResultRow(result, ConstructionProperties); // Call row.TailorMadeAssessmentResult = newValue;