Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/MacroStabilityOutwardsResultView.cs =================================================================== diff -u -r3178ee24ecea1a0386172513841285358fdeedd3 -r65ecce2ef0da000953113aa8c5746cc06d4b7e18 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/MacroStabilityOutwardsResultView.cs (.../MacroStabilityOutwardsResultView.cs) (revision 3178ee24ecea1a0386172513841285358fdeedd3) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/MacroStabilityOutwardsResultView.cs (.../MacroStabilityOutwardsResultView.cs) (revision 65ecce2ef0da000953113aa8c5746cc06d4b7e18) @@ -103,6 +103,10 @@ FailureMechanismSectionResultColumnBuilder.AddSimpleAssessmentAssemblyColumn( DataGridViewControl, nameof(MacroStabilityOutwardsSectionResultRow.SimpleAssemblyCategoryGroup)); + + FailureMechanismSectionResultColumnBuilder.AddDetailedAssessmentAssemblyColumn( + DataGridViewControl, + nameof(MacroStabilityOutwardsSectionResultRow.DetailedAssemblyCategoryGroup)); } private static IEnumerable> CreateFormattingRules() Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/MacrostabilityOutwardsResultViewTest.cs =================================================================== diff -u -r3178ee24ecea1a0386172513841285358fdeedd3 -r65ecce2ef0da000953113aa8c5746cc06d4b7e18 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/MacrostabilityOutwardsResultViewTest.cs (.../MacrostabilityOutwardsResultViewTest.cs) (revision 3178ee24ecea1a0386172513841285358fdeedd3) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/MacrostabilityOutwardsResultViewTest.cs (.../MacrostabilityOutwardsResultViewTest.cs) (revision 65ecce2ef0da000953113aa8c5746cc06d4b7e18) @@ -26,6 +26,7 @@ using NUnit.Extensions.Forms; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.Helpers; @@ -48,6 +49,8 @@ private const int tailorMadeAssessmentResultIndex = 4; private const int tailorMadeAssessmentProbabilityIndex = 5; private const int simpleAssemblyCategoryGroupIndex = 6; + private const int detailedAssemblyCategoryGroupIndex = 7; + private const int columnCount = 8; [Test] public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() @@ -104,7 +107,7 @@ // Then var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - Assert.AreEqual(7, dataGridView.ColumnCount); + Assert.AreEqual(columnCount, dataGridView.ColumnCount); Assert.IsInstanceOf(dataGridView.Columns[nameColumnIndex]); Assert.IsInstanceOf(dataGridView.Columns[simpleAssessmentIndex]); @@ -113,6 +116,7 @@ Assert.IsInstanceOf(dataGridView.Columns[tailorMadeAssessmentResultIndex]); Assert.IsInstanceOf(dataGridView.Columns[tailorMadeAssessmentProbabilityIndex]); Assert.IsInstanceOf(dataGridView.Columns[simpleAssemblyCategoryGroupIndex]); + Assert.IsInstanceOf(dataGridView.Columns[detailedAssemblyCategoryGroupIndex]); Assert.AreEqual("Vak", dataGridView.Columns[nameColumnIndex].HeaderText); Assert.AreEqual("Eenvoudige toets", dataGridView.Columns[simpleAssessmentIndex].HeaderText); @@ -121,6 +125,7 @@ Assert.AreEqual("Toets op maat", dataGridView.Columns[tailorMadeAssessmentResultIndex].HeaderText); Assert.AreEqual("Toets op maat\r\nFaalkans", dataGridView.Columns[tailorMadeAssessmentProbabilityIndex].HeaderText); Assert.AreEqual("Assemblageresultaat\r\neenvoudige toets", dataGridView.Columns[simpleAssemblyCategoryGroupIndex].HeaderText); + Assert.AreEqual("Assemblageresultaat\r\ngedetailleerde toets per vak", dataGridView.Columns[detailedAssemblyCategoryGroupIndex].HeaderText); Assert.AreEqual(DataGridViewAutoSizeColumnsMode.AllCells, dataGridView.AutoSizeColumnsMode); Assert.AreEqual(DataGridViewContentAlignment.MiddleCenter, dataGridView.ColumnHeadersDefaultCellStyle.Alignment); @@ -132,11 +137,13 @@ public void FailureMechanismResultView_FailureMechanismSectionResultAssigned_SectionAddedAsRow() { // Setup - var random = new Random(21); + var failureMechanism = new MacroStabilityOutwardsFailureMechanism(); + var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); mocks.ReplayAll(); + var random = new Random(21); var result = new MacroStabilityOutwardsFailureMechanismSectionResult( FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1")) { @@ -151,21 +158,22 @@ // Call using (var form = new Form()) - using (var view = new MacroStabilityOutwardsResultView(sectionResults, new MacroStabilityOutwardsFailureMechanism(), assessmentSection)) + using (new AssemblyToolCalculatorFactoryConfig()) + using (var view = new MacroStabilityOutwardsResultView(sectionResults, failureMechanism, assessmentSection)) { form.Controls.Add(view); form.Show(); // Assert - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; DataGridViewRowCollection rows = dataGridView.Rows; Assert.AreEqual(1, rows.Count); DataGridViewRow dataGridViewRow = rows[0]; - var rowObject = (MacroStabilityOutwardsSectionResultRow) dataGridViewRow.DataBoundItem; + var rowObject = (MacroStabilityOutwardsSectionResultRow)dataGridViewRow.DataBoundItem; DataGridViewCellCollection cells = dataGridViewRow.Cells; - Assert.AreEqual(7, cells.Count); + Assert.AreEqual(columnCount, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); Assert.AreEqual(result.SimpleAssessmentResult, cells[simpleAssessmentIndex].Value); @@ -177,6 +185,7 @@ Assert.AreEqual(expectedTailorMadeAssessmentProbabilityString, cells[tailorMadeAssessmentProbabilityIndex].FormattedValue); Assert.AreEqual(rowObject.SimpleAssemblyCategoryGroup, cells[simpleAssemblyCategoryGroupIndex].Value); + Assert.AreEqual(rowObject.DetailedAssemblyCategoryGroup, cells[detailedAssemblyCategoryGroupIndex].Value); mocks.VerifyAll(); } }