Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismResultView.cs =================================================================== diff -u -rce2380f19bfb4ee9e63613a57656418466ba4abf -r97604c23ecbb32a091fa9978582378050f6a8b61 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismResultView.cs (.../GrassCoverErosionOutwardsFailureMechanismResultView.cs) (revision ce2380f19bfb4ee9e63613a57656418466ba4abf) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismResultView.cs (.../GrassCoverErosionOutwardsFailureMechanismResultView.cs) (revision 97604c23ecbb32a091fa9978582378050f6a8b61) @@ -32,6 +32,19 @@ public class GrassCoverErosionOutwardsFailureMechanismResultView : FailureMechanismResultView { + private const int simpleAssessmentResultIndex = 1; + private const int detailedAssessmentResultForFactorizedSignalingNormIndex = 2; + private const int detailedAssessmentResultForSignalingNormIndex = 3; + private const int detailedAssessmentResultForMechanismSpecificLowerLimitNormIndex = 4; + private const int detailedAssessmentResultForLowerLimitNormIndex = 5; + private const int detailedAssessmentResultForFactorizedLowerLimitNormIndex = 6; + private const int tailorMadeAssessmentResultIndex = 7; + private const int simpleAssemblyCategoryGroupIndex = 8; + private const int detailedAssemblyCategoryGroupIndex = 9; + private const int tailorMadeAssemblyCategoryGroupIndex = 10; + private const int combinedAssemblyCategoryGroupIndex = 11; + private const int manualAssemblyCategoryGroupIndex = 13; + /// /// /// Creates a new instance of . @@ -43,7 +56,23 @@ protected override GrassCoverErosionOutwardsFailureMechanismSectionResultRow CreateFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) { - return new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(sectionResult); + return new GrassCoverErosionOutwardsFailureMechanismSectionResultRow( + sectionResult, + new GrassCoverErosionOutwardsFailureMechanismSectionResultRow.ConstructionProperties + { + SimpleAssessmentResultIndex = simpleAssessmentResultIndex, + DetailedAssessmentResultForFactorizedSignalingNormIndex = detailedAssessmentResultForFactorizedSignalingNormIndex, + DetailedAssessmentResultForSignalingNormIndex = detailedAssessmentResultForSignalingNormIndex, + DetailedAssessmentResultForMechanismSpecificLowerLimitNormIndex = detailedAssessmentResultForMechanismSpecificLowerLimitNormIndex, + DetailedAssessmentResultForLowerLimitNormIndex = detailedAssessmentResultForLowerLimitNormIndex, + DetailedAssessmentResultForFactorizedLowerLimitNormIndex = detailedAssessmentResultForFactorizedLowerLimitNormIndex, + TailorMadeAssessmentResultIndex = tailorMadeAssessmentResultIndex, + SimpleAssemblyCategoryGroupIndex = simpleAssemblyCategoryGroupIndex, + DetailedAssemblyCategoryGroupIndex = detailedAssemblyCategoryGroupIndex, + TailorMadeAssemblyCategoryGroupIndex = tailorMadeAssemblyCategoryGroupIndex, + CombinedAssemblyCategoryGroupIndex = combinedAssemblyCategoryGroupIndex, + ManualAssemblyCategoryGroupIndex = manualAssemblyCategoryGroupIndex + }); } protected override void AddDataGridColumns() Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs =================================================================== diff -u -r74e4073a2efeffdce54a1aad54ff7154c89ed9f2 -r97604c23ecbb32a091fa9978582378050f6a8b61 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs) (revision 74e4073a2efeffdce54a1aad54ff7154c89ed9f2) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs) (revision 97604c23ecbb32a091fa9978582378050f6a8b61) @@ -35,6 +35,19 @@ /// public class GrassCoverErosionOutwardsFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { + private readonly int simpleAssessmentResultIndex; + private readonly int detailedAssessmentResultForFactorizedSignalingNormIndex; + private readonly int detailedAssessmentResultForSignalingNormIndex; + private readonly int detailedAssessmentResultForMechanismSpecificLowerLimitNormIndex; + private readonly int detailedAssessmentResultForLowerLimitNormIndex; + private readonly int detailedAssessmentResultForFactorizedLowerLimitNormIndex; + private readonly int tailorMadeAssessmentResultIndex; + private readonly int simpleAssemblyCategoryGroupIndex; + private readonly int detailedAssemblyCategoryGroupIndex; + private readonly int tailorMadeAssemblyCategoryGroupIndex; + private readonly int combinedAssemblyCategoryGroupIndex; + private readonly int manualAssemblyCategoryGroupIndex; + private FailureMechanismSectionAssemblyCategoryGroup simpleAssemblyCategoryGroup; private FailureMechanismSectionAssemblyCategoryGroup detailedAssemblyCategoryGroup; private FailureMechanismSectionAssemblyCategoryGroup tailorMadeAssemblyCategoryGroup; @@ -45,10 +58,33 @@ /// /// The to wrap /// so that it can be displayed as a row. - /// Thrown when is null. - internal GrassCoverErosionOutwardsFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) + /// The property values required to create an instance of + /// . + /// Thrown when any parameter is null. + /// Thrown when + /// is a valid value, but unsupported. + internal GrassCoverErosionOutwardsFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult, + ConstructionProperties constructionProperties) : base(sectionResult) { + if (constructionProperties == null) + { + throw new ArgumentNullException(nameof(constructionProperties)); + } + + simpleAssessmentResultIndex = constructionProperties.SimpleAssessmentResultIndex; + detailedAssessmentResultForFactorizedSignalingNormIndex = constructionProperties.DetailedAssessmentResultForFactorizedSignalingNormIndex; + detailedAssessmentResultForSignalingNormIndex = constructionProperties.DetailedAssessmentResultForSignalingNormIndex; + detailedAssessmentResultForMechanismSpecificLowerLimitNormIndex = constructionProperties.DetailedAssessmentResultForMechanismSpecificLowerLimitNormIndex; + detailedAssessmentResultForLowerLimitNormIndex = constructionProperties.DetailedAssessmentResultForLowerLimitNormIndex; + detailedAssessmentResultForFactorizedLowerLimitNormIndex = constructionProperties.DetailedAssessmentResultForFactorizedLowerLimitNormIndex; + tailorMadeAssessmentResultIndex = constructionProperties.TailorMadeAssessmentResultIndex; + simpleAssemblyCategoryGroupIndex = constructionProperties.SimpleAssemblyCategoryGroupIndex; + detailedAssemblyCategoryGroupIndex = constructionProperties.DetailedAssemblyCategoryGroupIndex; + tailorMadeAssemblyCategoryGroupIndex = constructionProperties.TailorMadeAssemblyCategoryGroupIndex; + combinedAssemblyCategoryGroupIndex = constructionProperties.CombinedAssemblyCategoryGroupIndex; + manualAssemblyCategoryGroupIndex = constructionProperties.ManualAssemblyCategoryGroupIndex; + Update(); } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r4bcead3f76f6dce4ac4d13ce5dda2f1f6d1d0b2c -r97604c23ecbb32a091fa9978582378050f6a8b61 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs) (revision 4bcead3f76f6dce4ac4d13ce5dda2f1f6d1d0b2c) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs) (revision 97604c23ecbb32a091fa9978582378050f6a8b61) @@ -42,6 +42,28 @@ [TestFixture] public class GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest { + private static GrassCoverErosionOutwardsFailureMechanismSectionResultRow.ConstructionProperties ConstructionProperties + { + get + { + return new GrassCoverErosionOutwardsFailureMechanismSectionResultRow.ConstructionProperties + { + SimpleAssessmentResultIndex = 1, + DetailedAssessmentResultForFactorizedSignalingNormIndex = 2, + DetailedAssessmentResultForSignalingNormIndex = 3, + DetailedAssessmentResultForMechanismSpecificLowerLimitNormIndex = 4, + DetailedAssessmentResultForLowerLimitNormIndex = 5, + DetailedAssessmentResultForFactorizedLowerLimitNormIndex = 6, + TailorMadeAssessmentResultIndex = 7, + SimpleAssemblyCategoryGroupIndex = 8, + DetailedAssemblyCategoryGroupIndex = 9, + TailorMadeAssemblyCategoryGroupIndex = 10, + CombinedAssemblyCategoryGroupIndex = 11, + ManualAssemblyCategoryGroupIndex = 13 + }; + } + } + [Test] public void Constructor_WithParameters_ExpectedValues() { @@ -52,7 +74,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { // Call - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Assert Assert.IsInstanceOf>(row); @@ -91,7 +113,7 @@ calculator.CombinedAssemblyCategoryOutput = random.NextEnumValue(); // Call - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Assert Assert.AreEqual(FailureMechanismSectionResultRowHelper.GetCategoryGroupDisplayname(calculator.SimpleAssessmentAssemblyOutput.Group), row.SimpleAssemblyCategoryGroup); @@ -121,7 +143,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Precondition Assert.IsFalse(result.UseManualAssemblyCategoryGroup); @@ -153,7 +175,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.ManualAssemblyCategoryGroup = newValue; @@ -185,7 +207,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.SimpleAssessmentResult = newValue; @@ -214,7 +236,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.DetailedAssessmentResultForFactorizedSignalingNorm = newValue; @@ -243,7 +265,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.DetailedAssessmentResultForSignalingNorm = newValue; @@ -272,7 +294,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = newValue; @@ -301,7 +323,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.DetailedAssessmentResultForLowerLimitNorm = newValue; @@ -330,7 +352,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.DetailedAssessmentResultForFactorizedLowerLimitNorm = newValue; @@ -359,7 +381,7 @@ using (new AssemblyToolCalculatorFactoryConfig()) { - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result, ConstructionProperties); // Call row.TailorMadeAssessmentResult = newValue; Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverResultView.cs =================================================================== diff -u -rab22a70795dbeb68eff75821c348ca223d22b440 -r97604c23ecbb32a091fa9978582378050f6a8b61 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverResultView.cs (.../StabilityStoneCoverResultView.cs) (revision ab22a70795dbeb68eff75821c348ca223d22b440) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverResultView.cs (.../StabilityStoneCoverResultView.cs) (revision 97604c23ecbb32a091fa9978582378050f6a8b61) @@ -55,7 +55,8 @@ protected override StabilityStoneCoverSectionResultRow CreateFailureMechanismSectionResultRow(StabilityStoneCoverFailureMechanismSectionResult sectionResult) { - return new StabilityStoneCoverSectionResultRow(sectionResult, + return new StabilityStoneCoverSectionResultRow( + sectionResult, new StabilityStoneCoverSectionResultRow.ConstructionProperties { SimpleAssessmentResultIndex = simpleAssessmentResultIndex,