Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -391,6 +391,10 @@ var gui = mockRepository.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); + + var testDesignWaterLevelCalculator = new TestDesignWaterLevelCalculator(); + var calculatorFactory = mockRepository.Stub(); + calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(testDesignWaterLevelCalculator); mockRepository.ReplayAll(); using (var plugin = new GrassCoverErosionOutwardsPlugin()) @@ -400,19 +404,14 @@ plugin.Activate(); using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - var testFactory = (TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance; - // Call contextMenuAdapter.Items[contextMenuRunDesignWaterLevelCalculationsIndex].PerformClick(); // Assert - TestDesignWaterLevelCalculator testDesignWaterLevelCalculator = testFactory.DesignWaterLevelCalculator; AssessmentLevelCalculationInput designWaterLevelCalculationInput = testDesignWaterLevelCalculator.ReceivedInputs.First(); - Assert.AreEqual(testDataPath, testDesignWaterLevelCalculator.HydraulicBoundaryDatabaseDirectory); - Assert.AreEqual(grassCoverErosionOutwardsHydraulicBoundaryLocation.Id, designWaterLevelCalculationInput.HydraulicBoundaryLocationId); double expectedProbability = RingtoetsCommonDataCalculationService.ProfileSpecificRequiredProbability( assessmentSection.FailureMechanismContribution.Norm, @@ -448,6 +447,13 @@ var gui = mockRepository.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); + + var testDesignWaterLevelCalculator = new TestDesignWaterLevelCalculator + { + Converged = false + }; + var calculatorFactory = mockRepository.Stub(); + calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(testDesignWaterLevelCalculator); mockRepository.ReplayAll(); using (var plugin = new GrassCoverErosionOutwardsPlugin()) @@ -457,11 +463,8 @@ plugin.Activate(); using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - TestDesignWaterLevelCalculator testDesignWaterLevelCalculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).DesignWaterLevelCalculator; - testDesignWaterLevelCalculator.Converged = false; - // When Action call = () => contextMenuAdapter.Items[contextMenuRunDesignWaterLevelCalculationsIndex].PerformClick(); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r7f8860b7aa23930fb9f49e9a28d8ebb709395cb5 -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 7f8860b7aa23930fb9f49e9a28d8ebb709395cb5) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -43,6 +43,7 @@ using Ringtoets.Common.Data.TestUtil; using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects; +using Ringtoets.HydraRing.Calculation.Calculator.Factory; using Ringtoets.HydraRing.Calculation.TestUtil.Calculator; using Ringtoets.Revetment.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -1357,11 +1358,13 @@ gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); gui.Stub(g => g.MainWindow).Return(mainWindow); + var calculatorFactory = mocks.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveConditionsCosineCalculator(testDataPath)).Return(new TestWaveConditionsCosineCalculator()); mocks.ReplayAll(); plugin.Gui = gui; - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) { // When Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -re60dadeb730f975383e6c9febd0fd10f89ca1961 -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision e60dadeb730f975383e6c9febd0fd10f89ca1961) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -44,6 +44,7 @@ using Ringtoets.Common.Forms; using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects; +using Ringtoets.HydraRing.Calculation.Calculator.Factory; using Ringtoets.HydraRing.Calculation.TestUtil.Calculator; using Ringtoets.Revetment.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -1000,9 +1001,11 @@ gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mainWindow); + var calculatorFactory = mocks.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveConditionsCosineCalculator(hrdPath)).Return(new TestWaveConditionsCosineCalculator()); mocks.ReplayAll(); - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { // Call @@ -1056,9 +1059,11 @@ gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mainWindow); + var calculatorFactory = mocks.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveConditionsCosineCalculator(hrdPath)).Return(new TestWaveConditionsCosineCalculator()); mocks.ReplayAll(); - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { // Call @@ -1104,9 +1109,11 @@ gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mainWindow); + var calculatorFactory = mocks.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveConditionsCosineCalculator(hrdPath)).Return(new TestWaveConditionsCosineCalculator()); mocks.ReplayAll(); - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { // Call @@ -1179,9 +1186,11 @@ gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); gui.Stub(g => g.MainWindow).Return(mainWindow); + var calculatorFactory = mocks.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveConditionsCosineCalculator(hrdPath)).Return(new TestWaveConditionsCosineCalculator()); mocks.ReplayAll(); - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { // Call @@ -1367,12 +1376,12 @@ var updateHandler = mocks.Stub(); var viewCommands = mocks.Stub(); var menuBuilder = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - updateHandler, - viewCommands, - context, - treeViewControl); + importHandler, + exportHandler, + updateHandler, + viewCommands, + context, + treeViewControl); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilder); @@ -1417,12 +1426,12 @@ var updateHandler = mocks.Stub(); var viewCommands = mocks.Stub(); var menuBuilder = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - updateHandler, - viewCommands, - context, - treeViewControl); + importHandler, + exportHandler, + updateHandler, + viewCommands, + context, + treeViewControl); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilder); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -387,16 +387,21 @@ var gui = mockRepository.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); + + var testWaveHeightCalculator = new TestWaveHeightCalculator + { + EndInFailure = true + }; + var calculatorFactory = mockRepository.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); mockRepository.ReplayAll(); plugin.Gui = gui; plugin.Activate(); using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).WaveHeightCalculator.EndInFailure = true; - // When contextMenuAdapter.Items[contextMenuRunWaveHeightCalculationsIndex].PerformClick(); @@ -435,6 +440,10 @@ var gui = mockRepository.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); + + var testWaveHeightCalculator = new TestWaveHeightCalculator(); + var calculatorFactory = mockRepository.Stub(); + calculatorFactory.Stub(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); mockRepository.ReplayAll(); using (var plugin = new GrassCoverErosionOutwardsPlugin()) @@ -444,19 +453,14 @@ plugin.Activate(); using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - var testFactory = (TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance; - // Call contextMenuAdapter.Items[contextMenuRunWaveHeightCalculationsIndex].PerformClick(); // Assert - TestWaveHeightCalculator testWaveHeightCalculator = testFactory.WaveHeightCalculator; WaveHeightCalculationInput waveHeightCalculationInput = testWaveHeightCalculator.ReceivedInputs.First(); - Assert.AreEqual(testDataPath, testWaveHeightCalculator.HydraulicBoundaryDatabaseDirectory); - Assert.AreEqual(grassCoverErosionOutwardsHydraulicBoundaryLocation.Id, waveHeightCalculationInput.HydraulicBoundaryLocationId); double expectedProbability = assessmentSection.FailureMechanismContribution.Norm * (failureMechanism.Contribution / 100) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -283,6 +283,13 @@ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); gui.Stub(g => g.DocumentViewController).Return(mockRepository.Stub()); + + var testDesignWaterLevelCalculator = new TestDesignWaterLevelCalculator + { + Converged = false + }; + var calculatorFactory = mockRepository.Stub(); + calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(testDesignWaterLevelCalculator); mockRepository.ReplayAll(); DialogBoxHandler = (name, wnd) => @@ -297,11 +304,8 @@ plugin.Activate(); using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - TestDesignWaterLevelCalculator testDesignWaterLevelCalculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).DesignWaterLevelCalculator; - testDesignWaterLevelCalculator.Converged = false; - // When Action call = () => contextMenuAdapter.Items[contextMenuRunAssessmentLevelCalculationsIndex].PerformClick(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -284,6 +284,13 @@ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); gui.Stub(g => g.DocumentViewController).Return(mockRepository.Stub()); + + var testWaveHeightCalculator = new TestWaveHeightCalculator + { + Converged = false + }; + var calculatorFactory = mockRepository.Stub(); + calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); mockRepository.ReplayAll(); DialogBoxHandler = (name, wnd) => @@ -298,11 +305,8 @@ plugin.Activate(); using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { - TestWaveHeightCalculator testWaveHeightCalculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).WaveHeightCalculator; - testWaveHeightCalculator.Converged = false; - // When Action action = () => contextMenuAdapter.Items[contextMenuRunWaveHeightCalculationsIndex].PerformClick(); Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Integration.Test/Ringtoets.StabilityStoneCover.Integration.Test.csproj =================================================================== diff -u -r08b3bcba439831d547684b194ecdf903f2519700 -r5e277dcad3ff1c784146f964852c0f7371565ba1 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Integration.Test/Ringtoets.StabilityStoneCover.Integration.Test.csproj (.../Ringtoets.StabilityStoneCover.Integration.Test.csproj) (revision 08b3bcba439831d547684b194ecdf903f2519700) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Integration.Test/Ringtoets.StabilityStoneCover.Integration.Test.csproj (.../Ringtoets.StabilityStoneCover.Integration.Test.csproj) (revision 5e277dcad3ff1c784146f964852c0f7371565ba1) @@ -75,10 +75,6 @@ {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data - - {52BA7627-CBAB-4209-BE77-3B5F31378277} - Ringtoets.Common.IO - {4843D6E5-066F-4795-94F5-1D53932DD03C} Ringtoets.Common.Data.TestUtil @@ -91,10 +87,6 @@ {74CBA865-9338-447F-BAD9-28312446AE84} Ringtoets.HydraRing.Calculation.TestUtil - - {11F1F874-45AF-43E4-8AE5-15A5C9593E28} - Ringtoets.Integration.Data - {87C2C553-C0BC-40BF-B1EA-B83BFF357F27} Ringtoets.Revetment.Data