Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r57517bf1c8e4d95cdd1d1e871891995c16cf94ea -r81017f9028c1527df883b1b51cc76283121ad481 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 57517bf1c8e4d95cdd1d1e871891995c16cf94ea) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 81017f9028c1527df883b1b51cc76283121ad481) @@ -185,6 +185,11 @@ Ringtoets.AssemblyTool.Forms False + + {c6309704-d67b-434c-bc98-9f8910bc1d10} + Ringtoets.ClosingStructures.Data + False + {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data @@ -210,6 +215,11 @@ Ringtoets.Common.Service False + + {d1068432-c172-4aa6-847b-d9deb4c6de26} + Ringtoets.DuneErosion.Data + False + {90de728e-48ef-4665-ab38-3d88e41d9f4d} Ringtoets.GrassCoverErosionInwards.Data @@ -225,6 +235,31 @@ Ringtoets.HeightStructures.Data False + + {83d6b73e-91d5-46b0-9218-955da1f75f7c} + Ringtoets.MacroStabilityInwards.Data + False + + + {ce994cc9-6f6a-48ac-b4be-02c30a21f4db} + Ringtoets.Piping.Data + False + + + {3d4b9740-8348-4434-8d77-b611fc6ee57f} + Ringtoets.StabilityPointStructures.Data + False + + + {b479e3af-7c34-488c-bb73-d324100d36c9} + Ringtoets.StabilityStoneCover.Data + False + + + {567e0b69-5280-41ce-add6-443725a61c86} + Ringtoets.WaveImpactAsphaltCover.Data + False + {11f1f874-45af-43e4-8ae5-15a5c9593e28} Ringtoets.Integration.Data Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs =================================================================== diff -u -r286dd94855581a1510e46fe49e21dce41234feb7 -r81017f9028c1527df883b1b51cc76283121ad481 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 286dd94855581a1510e46fe49e21dce41234feb7) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 81017f9028c1527df883b1b51cc76283121ad481) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Windows.Forms; using Core.Common.Controls.Views; using Ringtoets.Integration.Data; @@ -56,33 +55,52 @@ SetData(); } - public object Data { get; set; } - /// /// Gets the the view belongs to. /// public AssessmentSection AssessmentSection { get; } + public object Data { get; set; } + private void InitializeDataGridView() { dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Name), CommonGuiResources.FailureMechanismContributionView_GridColumn_Assessment, true); - dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Code), - RingtoetsCommonFormsResources.FailureMechanism_Code_DisplayName, + dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Code), + RingtoetsCommonFormsResources.FailureMechanism_Code_DisplayName, true); - dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Group), - RingtoetsCommonFormsResources.FailureMechanism_Group_DisplayName, + dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Group), + RingtoetsCommonFormsResources.FailureMechanism_Group_DisplayName, true); } private void SetData() { - IEnumerable rows = AssessmentSection.GetFailureMechanisms() - .Select(fm => new FailureMechanismAssemblyResultRow(fm)) - .ToList(); + var rows = new List + { + new FailureMechanismAssemblyResultRow(AssessmentSection.Piping), + new FailureMechanismAssemblyResultRow(AssessmentSection.GrassCoverErosionInwards), + new FailureMechanismAssemblyResultRow(AssessmentSection.MacroStabilityInwards), + new FailureMechanismAssemblyResultRow(AssessmentSection.MacroStabilityOutwards), + new FailureMechanismAssemblyResultRow(AssessmentSection.Microstability), + new FailureMechanismAssemblyResultRow(AssessmentSection.StabilityStoneCover), + new FailureMechanismAssemblyResultRow(AssessmentSection.WaveImpactAsphaltCover), + new FailureMechanismAssemblyResultRow(AssessmentSection.WaterPressureAsphaltCover), + new FailureMechanismAssemblyResultRow(AssessmentSection.GrassCoverErosionOutwards), + new FailureMechanismAssemblyResultRow(AssessmentSection.GrassCoverSlipOffOutwards), + new FailureMechanismAssemblyResultRow(AssessmentSection.GrassCoverSlipOffInwards), + new FailureMechanismAssemblyResultRow(AssessmentSection.HeightStructures), + new FailureMechanismAssemblyResultRow(AssessmentSection.ClosingStructures), + new FailureMechanismAssemblyResultRow(AssessmentSection.PipingStructure), + new FailureMechanismAssemblyResultRow(AssessmentSection.StabilityPointStructures), + new FailureMechanismAssemblyResultRow(AssessmentSection.StrengthStabilityLengthwiseConstruction), + new FailureMechanismAssemblyResultRow(AssessmentSection.DuneErosion), + new FailureMechanismAssemblyResultRow(AssessmentSection.TechnicalInnovation) + }; + dataGridViewControl.SetDataSource(rows); } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r57517bf1c8e4d95cdd1d1e871891995c16cf94ea -r81017f9028c1527df883b1b51cc76283121ad481 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 57517bf1c8e4d95cdd1d1e871891995c16cf94ea) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 81017f9028c1527df883b1b51cc76283121ad481) @@ -156,6 +156,10 @@ {0AB432BB-E2CC-42EA-A72C-7AFEF7536B38} Ringtoets.AssemblyTool.KernelWrapper.TestUtil + + {c6309704-d67b-434c-bc98-9f8910bc1d10} + Ringtoets.ClosingStructures.Data + {78AA56F5-431D-465C-AC50-3173D7E90AC1} Ringtoets.Common.Primitives @@ -164,10 +168,18 @@ {D24FA2F7-28A7-413B-AFD3-EE10E985630B} Ringtoets.Common.Forms.TestUtil + + {d1068432-c172-4aa6-847b-d9deb4c6de26} + Ringtoets.DuneErosion.Data + {BF753DB5-973B-4ADF-B0F6-9437325C3466} Ringtoets.GrassCoverErosionInwards.Data.TestUtil + + {83d6b73e-91d5-46b0-9218-955da1f75f7c} + Ringtoets.MacroStabilityInwards.Data + {955E574D-67CE-4347-AA6B-7DF8A04ED754} Ringtoets.Piping.Data.TestUtil @@ -204,6 +216,18 @@ {ce994cc9-6f6a-48ac-b4be-02c30a21f4db} Ringtoets.Piping.Data + + {3d4b9740-8348-4434-8d77-b611fc6ee57f} + Ringtoets.StabilityPointStructures.Data + + + {b479e3af-7c34-488c-bb73-d324100d36c9} + Ringtoets.StabilityStoneCover.Data + + + {567e0b69-5280-41ce-add6-443725a61c86} + Ringtoets.WaveImpactAsphaltCover.Data + {11f1f874-45af-43e4-8ae5-15a5c9593e28} Ringtoets.Integration.Data Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs =================================================================== diff -u -r5973ea19f0223d8e4331d1646e505032a569f0b4 -r81017f9028c1527df883b1b51cc76283121ad481 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision 5973ea19f0223d8e4331d1646e505032a569f0b4) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision 81017f9028c1527df883b1b51cc76283121ad481) @@ -26,10 +26,21 @@ using Core.Common.TestUtil; using NUnit.Extensions.Forms; using NUnit.Framework; +using Ringtoets.ClosingStructures.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.HeightStructures.Data; using Ringtoets.Integration.Data; +using Ringtoets.Integration.Data.StandAlone; using Ringtoets.Integration.Forms.Views; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Data; namespace Ringtoets.Integration.Forms.Test.Views { @@ -67,7 +78,7 @@ } [Test] - public void DefaultConstructor_DefaultValues() + public void Constructor_WithAssessmentSection_ExpectedValuesSet() { // Setup var random = new Random(21); @@ -118,22 +129,87 @@ Assert.IsTrue(dataGridViewColumns[failureMechanismNameColumnIndex].ReadOnly); Assert.IsTrue(dataGridViewColumns[failureMechanismCodeColumnIndex].ReadOnly); Assert.IsTrue(dataGridViewColumns[failureMechanismGroupColumnIndex].ReadOnly); + } + } + [Test] + public void GivenFormWithAssessmentSection_ThenExpectedRowsVisible() + { + // Given + var random = new Random(21); + var assessmentSection = new AssessmentSection(random.NextEnumValue()); + + // Then + using (var view = new AssemblyResultTotalView(assessmentSection)) + { + testForm.Controls.Add(view); + testForm.Show(); + + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; DataGridViewRowCollection rows = dataGridView.Rows; - IFailureMechanism[] failureMechanisms = assessmentSection.GetFailureMechanisms().ToArray(); - Assert.AreEqual(failureMechanisms.Length, rows.Count); + Assert.AreEqual(assessmentSection.GetFailureMechanisms().Count(), rows.Count); - for (var i = 0; i < failureMechanisms.Length; i++) - { - IFailureMechanism failureMechanism = failureMechanisms[i]; - DataGridViewCellCollection cells = rows[i].Cells; - Assert.AreEqual(expectedColumnCount, cells.Count); + PipingFailureMechanism piping = assessmentSection.Piping; + AssertAssemblyRow(piping, rows[0].Cells); - Assert.AreEqual(failureMechanism.Name, cells[failureMechanismNameColumnIndex].Value); - Assert.AreEqual(failureMechanism.Code, cells[failureMechanismCodeColumnIndex].Value); - Assert.AreEqual(failureMechanism.Group, cells[failureMechanismGroupColumnIndex].Value); - } + GrassCoverErosionInwardsFailureMechanism grassCoverErosionInwards = assessmentSection.GrassCoverErosionInwards; + AssertAssemblyRow(grassCoverErosionInwards, rows[1].Cells); + + MacroStabilityInwardsFailureMechanism macroStabilityInwards = assessmentSection.MacroStabilityInwards; + AssertAssemblyRow(macroStabilityInwards, rows[2].Cells); + + MacroStabilityOutwardsFailureMechanism macroStabilityOutwards = assessmentSection.MacroStabilityOutwards; + AssertAssemblyRow(macroStabilityOutwards, rows[3].Cells); + + MicrostabilityFailureMechanism microStability = assessmentSection.Microstability; + AssertAssemblyRow(microStability, rows[4].Cells); + + StabilityStoneCoverFailureMechanism stabilityStoneCover = assessmentSection.StabilityStoneCover; + AssertAssemblyRow(stabilityStoneCover, rows[5].Cells); + + WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCover = assessmentSection.WaveImpactAsphaltCover; + AssertAssemblyRow(waveImpactAsphaltCover, rows[6].Cells); + + WaterPressureAsphaltCoverFailureMechanism waterPressureAsphaltCover = assessmentSection.WaterPressureAsphaltCover; + AssertAssemblyRow(waterPressureAsphaltCover, rows[7].Cells); + + GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwards = assessmentSection.GrassCoverErosionOutwards; + AssertAssemblyRow(grassCoverErosionOutwards, rows[8].Cells); + + GrassCoverSlipOffOutwardsFailureMechanism grassCoverSlipOffOutwards = assessmentSection.GrassCoverSlipOffOutwards; + AssertAssemblyRow(grassCoverSlipOffOutwards, rows[9].Cells); + + GrassCoverSlipOffInwardsFailureMechanism grassCoverSlipOffInwards = assessmentSection.GrassCoverSlipOffInwards; + AssertAssemblyRow(grassCoverSlipOffInwards, rows[10].Cells); + + HeightStructuresFailureMechanism heightStructures = assessmentSection.HeightStructures; + AssertAssemblyRow(heightStructures, rows[11].Cells); + + ClosingStructuresFailureMechanism closingStructures = assessmentSection.ClosingStructures; + AssertAssemblyRow(closingStructures, rows[12].Cells); + + PipingStructureFailureMechanism pipingStructure = assessmentSection.PipingStructure; + AssertAssemblyRow(pipingStructure, rows[13].Cells); + + StabilityPointStructuresFailureMechanism stabilityPointStructures = assessmentSection.StabilityPointStructures; + AssertAssemblyRow(stabilityPointStructures, rows[14].Cells); + + StrengthStabilityLengthwiseConstructionFailureMechanism strengthStabilityLengthwiseConstruction = assessmentSection.StrengthStabilityLengthwiseConstruction; + AssertAssemblyRow(strengthStabilityLengthwiseConstruction, rows[15].Cells); + + DuneErosionFailureMechanism duneErosion = assessmentSection.DuneErosion; + AssertAssemblyRow(duneErosion, rows[16].Cells); + + TechnicalInnovationFailureMechanism technicalInnovation = assessmentSection.TechnicalInnovation; + AssertAssemblyRow(technicalInnovation, rows[17].Cells); } } + + private static void AssertAssemblyRow(IFailureMechanism failureMechanism, DataGridViewCellCollection row) + { + Assert.AreEqual(failureMechanism.Name, row[failureMechanismNameColumnIndex].Value); + Assert.AreEqual(failureMechanism.Code, row[failureMechanismCodeColumnIndex].Value); + Assert.AreEqual(failureMechanism.Group, row[failureMechanismGroupColumnIndex].Value); + } } } \ No newline at end of file