Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r6617058bc433d519ff1050ac5fb580b5f06da7ed -r35040098e742ca7a772fc7504167fb2e5773fabf --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 6617058bc433d519ff1050ac5fb580b5f06da7ed) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 35040098e742ca7a772fc7504167fb2e5773fabf) @@ -181,7 +181,8 @@ const string expectedItemText = "Alles be&rekenen"; const string expectedItemTooltip = "Er is geen hydraulische randvoorwaardendatabase beschikbaar om de toetspeilen te berekenen."; - TestHelper.AssertContextMenuStripContainsItem(contextMenu, 1, expectedItemText, expectedItemTooltip, RingtoetsCommonFormsResources.CalculateAllIcon, false); + TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuRunAssessmentLevelCalculationsIndex, + expectedItemText, expectedItemTooltip, RingtoetsCommonFormsResources.CalculateAllIcon, false); } } @@ -218,7 +219,8 @@ const string expectedItemText = @"Alles be&rekenen"; const string expectedItemTooltip = @"Alle toetspeilen berekenen."; - TestHelper.AssertContextMenuStripContainsItem(contextMenu, 1, expectedItemText, expectedItemTooltip, RingtoetsCommonFormsResources.CalculateAllIcon); + TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuRunAssessmentLevelCalculationsIndex, + expectedItemText, expectedItemTooltip, RingtoetsCommonFormsResources.CalculateAllIcon); } } @@ -230,7 +232,6 @@ { // Given var guiMock = mockRepository.DynamicMock(); - var contextMenuRunAssessmentLevelCalculationsIndex = 1; RoundedDouble designWaterLevel = (RoundedDouble) 4.2; var hydraulicBoundaryLocation1 = new HydraulicBoundaryLocation(100001, "", 1.1, 2.2); @@ -332,6 +333,8 @@ mockRepository.VerifyAll(); } + private const int contextMenuRunAssessmentLevelCalculationsIndex = 1; + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(DesignWaterLevelLocationsContext)); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r6617058bc433d519ff1050ac5fb580b5f06da7ed -r35040098e742ca7a772fc7504167fb2e5773fabf --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 6617058bc433d519ff1050ac5fb580b5f06da7ed) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 35040098e742ca7a772fc7504167fb2e5773fabf) @@ -43,6 +43,7 @@ namespace Ringtoets.Integration.Forms.Test.TreeNodeInfos { + [TestFixture] public class WaveHeightLocationsContextTreeNodeInfoTest : NUnitFormTest { private MockRepository mockRepository; @@ -180,7 +181,8 @@ // Assert const string expectedItemText = "Alles be&rekenen"; const string expectedItemTooltip = "Er is geen hydraulische randvoorwaardendatabase beschikbaar om de golfhoogtes te berekenen."; - TestHelper.AssertContextMenuStripContainsItem(contextMenu, 1, expectedItemText, expectedItemTooltip, Resources.CalculateAllIcon, false); + TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuRunWaveHeightCalculationsIndex, + expectedItemText, expectedItemTooltip, Resources.CalculateAllIcon, false); } } @@ -222,7 +224,8 @@ const string expectedItemText = "Alles be&rekenen"; const string expectedItemTooltip = "Alle golfhoogtes berekenen."; - TestHelper.AssertContextMenuStripContainsItem(contextMenu, 1, expectedItemText, expectedItemTooltip, Resources.CalculateAllIcon); + TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuRunWaveHeightCalculationsIndex, + expectedItemText, expectedItemTooltip, Resources.CalculateAllIcon); } } @@ -280,8 +283,6 @@ // Given var guiMock = mockRepository.DynamicMock(); - var contextMenuRunWaveHeightCalculationsIndex = 1; - RoundedDouble waveHeight = (RoundedDouble) 4.2; var hydraulicBoundaryLocation1 = new HydraulicBoundaryLocation(100001, "", 1.1, 2.2); var hydraulicBoundaryLocation2 = new HydraulicBoundaryLocation(100002, "", 3.3, 4.4) @@ -337,6 +338,8 @@ mockRepository.VerifyAll(); } + private const int contextMenuRunWaveHeightCalculationsIndex = 1; + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveHeightLocationsContext)); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs =================================================================== diff -u -r6617058bc433d519ff1050ac5fb580b5f06da7ed -r35040098e742ca7a772fc7504167fb2e5773fabf --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision 6617058bc433d519ff1050ac5fb580b5f06da7ed) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision 35040098e742ca7a772fc7504167fb2e5773fabf) @@ -41,9 +41,9 @@ namespace Ringtoets.Integration.Forms.Test.Views { + [TestFixture] public class HydraulicBoundaryLocationsViewTest { - private const int locationCalculateColumnIndex = 0; private Form testForm; [SetUp] @@ -261,7 +261,7 @@ } [Test] - public void CalculateForSelectedButton_OneSelected_CallsCalculateDesignWaterLevels() + public void CalculateForSelectedButton_OneSelected_CallsCalculateHandleCalculateSelectedLocations() { // Setup TestHydraulicBoundaryLocationsView view = ShowFullyConfiguredTestHydraulicBoundaryLocationsView(); @@ -306,6 +306,8 @@ Assert.DoesNotThrow(test); } + private const int locationCalculateColumnIndex = 0; + private TestHydraulicBoundaryLocationsView ShowTestHydraulicBoundaryLocationsView() { var view = new TestHydraulicBoundaryLocationsView(); @@ -373,21 +375,22 @@ : base(wrappedData, hydraulicBoundaryLocation) {} } - private class TestHydraulicBoundaryLocationContextRow : HydraulicBoundaryLocationContextRow { - public TestHydraulicBoundaryLocationContextRow(HydraulicBoundaryLocationContext hydraulicBoundaryLocationContext) + private class TestHydraulicBoundaryLocationContextRow : HydraulicBoundaryLocationContextRow + { + public TestHydraulicBoundaryLocationContextRow(HydraulicBoundaryLocationContext hydraulicBoundaryLocationContext) : base(hydraulicBoundaryLocationContext) {} } private class TestHydraulicBoundaryLocationsView : HydraulicBoundaryLocationsView { - - public TestHydraulicBoundaryLocationsView() { dataGridViewControl.AddCheckBoxColumn(TypeUtils.GetMemberName(row => row.ToCalculate), ""); LocationsToCalculate = new List(); } + public IEnumerable LocationsToCalculate { get; private set; } + protected override void SetDataSource() { dataGridViewControl.SetDataSource(AssessmentSection != null && AssessmentSection.HydraulicBoundaryDatabase != null @@ -401,8 +404,6 @@ { LocationsToCalculate = locations; } - - public IEnumerable LocationsToCalculate { get; private set; } } } } \ No newline at end of file