Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenarioRowTest.cs =================================================================== diff -u -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 -rc899b9042ee83f3ac6d6213515d7edacfbe8c414 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenarioRowTest.cs (.../GrassCoverErosionInwardsScenarioRowTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenarioRowTest.cs (.../GrassCoverErosionInwardsScenarioRowTest.cs) (revision c899b9042ee83f3ac6d6213515d7edacfbe8c414) @@ -25,6 +25,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.Views; @@ -50,10 +51,11 @@ // Assert Assert.AreSame(sectionResult.Section.Name, row.Name); Assert.AreSame(sectionResult.Calculation, row.Calculation); + Assert.IsInstanceOf>(row); } [Test] - public void ParameterdConstructor_SectionResultIsNull_ThrowArgumentNullException() + public void ParameteredConstructor_SectionResultIsNull_ThrowArgumentNullException() { // Call TestDelegate call = () => new GrassCoverErosionInwardsScenarioRow(null); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenarioRowTest.cs =================================================================== diff -u -r5d503cf8885ced4799e5ad44242038d99e04b162 -rc899b9042ee83f3ac6d6213515d7edacfbe8c414 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenarioRowTest.cs (.../HeightStructuresScenarioRowTest.cs) (revision 5d503cf8885ced4799e5ad44242038d99e04b162) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenarioRowTest.cs (.../HeightStructuresScenarioRowTest.cs) (revision c899b9042ee83f3ac6d6213515d7edacfbe8c414) @@ -25,6 +25,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.Views; @@ -50,10 +51,11 @@ // Assert Assert.AreSame(sectionResult.Section.Name, row.Name); Assert.AreSame(sectionResult.Calculation, row.Calculation); + Assert.IsInstanceOf>(row); } [Test] - public void ParameterdConstructor_SectionResultIsNull_ThrowArgumentNullException() + public void ParameteredConstructor_SectionResultIsNull_ThrowArgumentNullException() { // Call TestDelegate call = () => new HeightStructuresScenarioRow(null); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs =================================================================== diff -u -r04e2ad28172dab2091ef18840dfc0ba77c6c0c7d -rc899b9042ee83f3ac6d6213515d7edacfbe8c414 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs (.../HeightStructuresScenariosViewTest.cs) (revision 04e2ad28172dab2091ef18840dfc0ba77c6c0c7d) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs (.../HeightStructuresScenariosViewTest.cs) (revision c899b9042ee83f3ac6d6213515d7edacfbe8c414) @@ -153,7 +153,7 @@ } [Test] - public void FailureMechanism_WithData_UpdateScenarioControl() + public void FailureMechanism_FailureMechanismSetToNull_UpdateScenarioControl() { // Setup using (var view = ShowScenariosView()) @@ -240,7 +240,7 @@ } [Test] - public void NotifyCalculation_CalculationChangedDikeProfile_CalculationMovedToOtherSectionResultOptions() + public void NotifyCalculation_CalculationChangedStructure_CalculationMovedToOtherSectionResultOptions() { // Setup using (var view = ShowScenariosView()) @@ -314,13 +314,13 @@ } } - private void AssertDataGridView( + private static void AssertDataGridView( HeightStructuresFailureMechanism failureMechanism, bool shouldBeCleared, string[][] expectedComboBoxItemTexts = null) { var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - var rowCount = dataGridView.RowCount; + int rowCount = dataGridView.RowCount; if (shouldBeCleared) { @@ -344,7 +344,7 @@ private HeightStructuresFailureMechanism CreateCompleteFailureMechanism() { - HeightStructuresFailureMechanism failureMechanism = new HeightStructuresFailureMechanism(); + var failureMechanism = new HeightStructuresFailureMechanism(); var matchingPointA = new Point2D(0, 0); var matchingPointB = new Point2D(20, 20); var calculationA = new HeightStructuresCalculation @@ -363,7 +363,7 @@ Structure = new TestHeightStructure(matchingPointB) } }; - Point2D connectionPoint = new Point2D(10, 10); + var connectionPoint = new Point2D(10, 10); var failureMechanismSectionA = new FailureMechanismSection("sectionA", new[] { matchingPointA, Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs =================================================================== diff -u -r3dc04fc5fb21350c7b4da44fdba336aead86560e -rc899b9042ee83f3ac6d6213515d7edacfbe8c414 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs (.../HeightStructuresScenariosViewIntegrationTest.cs) (revision 3dc04fc5fb21350c7b4da44fdba336aead86560e) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs (.../HeightStructuresScenariosViewIntegrationTest.cs) (revision c899b9042ee83f3ac6d6213515d7edacfbe8c414) @@ -42,15 +42,15 @@ Path.Combine("HeightStructures", "kunstwerken_6_3.shp")); [Test] - public void ScenariosView_ImportDikeSection_ChangesCorrectlyObservedAndSynced() + public void ScenariosView_ImportFailureMechanismSections_ChangesCorrectlyObservedAndSynced() { // Setup using (var form = new Form()) { var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); IntegrationTestHelper.ImportReferenceLine(assessmentSection); - var view = new HeightStructuresScenariosView() + var view = new HeightStructuresScenariosView { Data = assessmentSection.HeightStructures.CalculationsGroup, FailureMechanism = assessmentSection.HeightStructures @@ -91,7 +91,7 @@ .Import(); CalculationGroup calculationsGroup = assessmentSection.HeightStructures.CalculationsGroup; - var view = new HeightStructuresScenariosView() + var view = new HeightStructuresScenariosView { Data = calculationsGroup, FailureMechanism = assessmentSection.HeightStructures @@ -179,7 +179,7 @@ } [Test] - public void ScenariosView_ChangeDikeProfileOfCalculation_ChangesCorrectlyObservedAndSynced() + public void ScenariosView_ChangeStructureOfCalculation_ChangesCorrectlyObservedAndSynced() { // Setup using (var form = new Form()) Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs =================================================================== diff -u -r5d503cf8885ced4799e5ad44242038d99e04b162 -rc899b9042ee83f3ac6d6213515d7edacfbe8c414 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision 5d503cf8885ced4799e5ad44242038d99e04b162) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision c899b9042ee83f3ac6d6213515d7edacfbe8c414) @@ -235,8 +235,11 @@ Data = new CalculationGroup() }; - // Call & Assert - Assert.IsFalse(info.CloseForData(view, assessmentSectionMock)); + // Call + bool closeForData = info.CloseForData(view, assessmentSectionMock); + + // Assert + Assert.IsFalse(closeForData); mocks.VerifyAll(); } @@ -257,8 +260,11 @@ Data = new CalculationGroup() }; - // Call & Assert - Assert.IsFalse(info.CloseForData(view, assessmentSectionMock)); + // Call + bool closeForData = info.CloseForData(view, assessmentSectionMock); + + // Assert + Assert.IsFalse(closeForData); mocks.VerifyAll(); } @@ -280,8 +286,11 @@ Data = failureMechanism.CalculationsGroup }; - // Call & Assert - Assert.IsTrue(info.CloseForData(view, assessmentSectionMock)); + // Call + bool closeForData = info.CloseForData(view, assessmentSectionMock); + + // Assert + Assert.IsTrue(closeForData); mocks.VerifyAll(); } @@ -294,8 +303,11 @@ view.Data = new CalculationGroup(); - // Call & Assert - Assert.IsFalse(info.CloseForData(view, failureMechanism)); + // Call + bool closeForData = info.CloseForData(view, failureMechanism); + + // Assert + Assert.IsFalse(closeForData); } [Test] @@ -307,16 +319,18 @@ view.Data = failureMechanism.CalculationsGroup; - // Call & Assert - Assert.IsTrue(info.CloseForData(view, failureMechanism)); + // Call + bool closeForData = info.CloseForData(view, failureMechanism); + + // Assert + Assert.IsTrue(closeForData); } [Test] public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanismContext_ReturnsFalse() { // Setup var assessmentSectionMock = mocks.StrictMock(); - mocks.ReplayAll(); var view = new HeightStructuresScenariosView(); @@ -325,17 +339,19 @@ view.Data = failureMechanism.CalculationsGroup; - // Call & Assert - Assert.IsFalse(info.CloseForData(view, failureMechanismContext)); + // Call + bool closeForData = info.CloseForData(view, failureMechanismContext); + + // Assert + Assert.IsFalse(closeForData); mocks.VerifyAll(); } [Test] public void CloseForData_ViewCorrespondingToRemovedFailureMechanismContext_ReturnsTrue() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - + var assessmentSectionMock = mocks.Stub(); mocks.ReplayAll(); var view = new HeightStructuresScenariosView(); @@ -344,8 +360,11 @@ view.Data = failureMechanism.CalculationsGroup; - // Call & Assert - Assert.IsTrue(info.CloseForData(view, failureMechanismContext)); + // Call + bool closeForData = info.CloseForData(view, failureMechanismContext); + + // Assert + Assert.IsTrue(closeForData); mocks.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rb6f4e414fc874653cc6ad84b80f330b28e69b823 -rc899b9042ee83f3ac6d6213515d7edacfbe8c414 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision b6f4e414fc874653cc6ad84b80f330b28e69b823) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision c899b9042ee83f3ac6d6213515d7edacfbe8c414) @@ -57,7 +57,6 @@ { private const int contextMenuAddCalculationGroupIndexRootGroup = 4; private const int contextMenuAddCalculationIndexRootGroup = 5; - private const int contextMenuRemoveAllChildrenIndexRootGroup = 7; private const int contextMenuValidateAllIndexRootGroup = 9; private const int contextMenuCalculateAllIndexRootGroup = 10; private const int contextMenuClearOutputIndexRootGroup = 11; @@ -72,7 +71,7 @@ private const int contextMenuClearOutputNestedGroupIndex = 5; private const int customOnlyContextMenuAddGenerateCalculationsIndex = 1; - private const int customOnlyContextMenuRemoveAllChildrenIndex = 6; + private MockRepository mocks; private PipingPlugin plugin; private TreeNodeInfo info;