Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -rf5bac1f11df4ee4881109371c50120763e303642 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsContextTreeNodeInfoTest.cs) (revision f5bac1f11df4ee4881109371c50120763e303642) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.Drawing; using System.IO; using System.Linq; @@ -239,7 +238,7 @@ CollectionAssert.AllItemsAreInstancesOfType(new[] { menu.Items[1], - menu.Items[3], + menu.Items[3] }, typeof(ToolStripSeparator)); } } @@ -304,7 +303,7 @@ CollectionAssert.AllItemsAreInstancesOfType(new[] { menu.Items[1], - menu.Items[3], + menu.Items[3] }, typeof(ToolStripSeparator)); } } @@ -420,54 +419,6 @@ mockRepository.VerifyAll(); } - [Test] - public void CalculateWaveHeightsFromContextMenu_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 GrassCoverErosionOutwardsWaveHeightLocationsContext(new ObservableList - { - grassCoverErosionOutwardsHydraulicBoundaryLocation - }, assessmentSectionStub, new GrassCoverErosionOutwardsFailureMechanism()); - - 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()) - { - // Call - Action action = () => contextMenuAdapter.Items[contextMenuRunWaveHeightCalculationsIndex].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."); - Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight); - } - } - } - mockRepository.VerifyAll(); - } - private static TreeNodeInfo GetInfo(GrassCoverErosionOutwardsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionOutwardsWaveHeightLocationsContext));