Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -rf5bac1f11df4ee4881109371c50120763e303642 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision f5bac1f11df4ee4881109371c50120763e303642) @@ -245,7 +245,7 @@ CollectionAssert.AllItemsAreInstancesOfType(new[] { menu.Items[1], - menu.Items[3], + menu.Items[3] }, typeof(ToolStripSeparator)); } } @@ -317,7 +317,7 @@ CollectionAssert.AllItemsAreInstancesOfType(new[] { menu.Items[1], - menu.Items[3], + menu.Items[3] }, typeof(ToolStripSeparator)); } } @@ -517,61 +517,6 @@ mockRepository.VerifyAll(); } - [Test] - public void CalculateDesignWaterLevelsFromContextMenu_ContributionZero_DoesNotCalculateAndLog() - { - // Setup - var guiMock = mockRepository.DynamicMock(); - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 0 - }; - IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub( - failureMechanism, mockRepository, Path.Combine(testDataPath, "HRD ijsselmeer.sqlite")); - - var grassCoverErosionOutwardsHydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations[0]; - var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(new ObservableList - { - grassCoverErosionOutwardsHydraulicBoundaryLocation - }, assessmentSectionStub, failureMechanism); - - var contextObserverMock = mockRepository.StrictMock(); - context.Attach(contextObserverMock); - - using (var treeViewControl = new TreeViewControl()) - { - guiMock.Expect(g => g.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - guiMock.Expect(g => g.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new GrassCoverErosionOutwardsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - plugin.Gui = guiMock; - plugin.Activate(); - - using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) - using (new HydraRingCalculatorFactoryConfig()) - { - var testFactory = (TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance; - - // Call - Action action = () => contextMenuAdapter.Items[contextMenuRunDesignWaterLevelCalculationsIndex].PerformClick(); - - // Assert - TestHelper.AssertLogMessageIsGenerated(action, "De bijdrage van dit toetsspoor is nul. Daardoor is de doorsnede-eis onbepaald en kunnen de berekeningen niet worden uitgevoerd."); - - var testDesignWaterLevelCalculator = testFactory.DesignWaterLevelCalculator; - Assert.IsEmpty(testDesignWaterLevelCalculator.ReceivedInputs); - - Assert.That(string.IsNullOrEmpty(testDesignWaterLevelCalculator.HydraulicBoundaryDatabaseDirectory)); - Assert.That(string.IsNullOrEmpty(testDesignWaterLevelCalculator.RingId)); - } - } - } - mockRepository.VerifyAll(); - } - private static TreeNodeInfo GetInfo(GrassCoverErosionOutwardsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionOutwardsDesignWaterLevelLocationsContext));