Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/DuneErosionPlugin.cs =================================================================== diff -u -rd2a8037bae5f31d028878b7707a24935e2e89322 -r07a49c4b3a674477dde39e753bfab49ead03ae99 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/DuneErosionPlugin.cs (.../DuneErosionPlugin.cs) (revision d2a8037bae5f31d028878b7707a24935e2e89322) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/DuneErosionPlugin.cs (.../DuneErosionPlugin.cs) (revision 07a49c4b3a674477dde39e753bfab49ead03ae99) @@ -102,9 +102,6 @@ { Text = context => RingtoetsCommonDataResources.HydraulicBoundaryConditions_DisplayName, Image = context => RingtoetsCommonFormsResources.GenericInputOutputIcon, - ForeColor = context => context.WrappedData.Any() - ? Color.FromKnownColor(KnownColor.ControlText) - : Color.FromKnownColor(KnownColor.GrayText), ContextMenuStrip = DuneLocationsContextMenuStrip }; } @@ -309,19 +306,13 @@ #region DuneLocationsContext TreeNodeInfo private static string ValidateAllDataAvailableAndGetErrorMessage(IAssessmentSection assessmentSection, - double failureMechanismContribution, - IEnumerable calculations) + double failureMechanismContribution) { if (failureMechanismContribution <= 0.0) { return RingtoetsCommonFormsResources.Contribution_of_failure_mechanism_zero; } - if (!calculations.Any()) - { - return Resources.DuneErosionPlugin_DuneLocationsContextMenuStrip_Calculate_all_ToolTip_no_locations; - } - return HydraulicBoundaryDatabaseConnectionValidator.Validate(assessmentSection.HydraulicBoundaryDatabase); } @@ -345,8 +336,7 @@ }); string validationText = ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection, - context.FailureMechanism.Contribution, - context.WrappedData); + context.FailureMechanism.Contribution); if (!string.IsNullOrEmpty(validationText)) { calculateAllItem.Enabled = false; Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r330f2e86f2fb575c436cdbb46b6d31bc246ef6fc -r07a49c4b3a674477dde39e753bfab49ead03ae99 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 330f2e86f2fb575c436cdbb46b6d31bc246ef6fc) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 07a49c4b3a674477dde39e753bfab49ead03ae99) @@ -40,7 +40,7 @@ // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -91,16 +91,6 @@ } /// - /// Looks up a localized string similar to Er zijn geen locaties om een berekening voor uit te voeren.. - /// - internal static string DuneErosionPlugin_DuneLocationsContextMenuStrip_Calculate_all_ToolTip_no_locations { - get { - return ResourceManager.GetString("DuneErosionPlugin_DuneLocationsContextMenuStrip_Calculate_all_ToolTip_no_location" + - "s", resourceCulture); - } - } - - /// /// Looks up a localized string similar to MorphAn randvoorwaarden. /// internal static string DuneErosionPlugin_GetExportInfos_MorphAn_boundary_conditions_file_filter_Description { Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/Properties/Resources.resx =================================================================== diff -u -r392383a267a69010698aef6948b1e53c6a889bae -r07a49c4b3a674477dde39e753bfab49ead03ae99 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 392383a267a69010698aef6948b1e53c6a889bae) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 07a49c4b3a674477dde39e753bfab49ead03ae99) @@ -120,9 +120,6 @@ Alle hydraulische randvoorwaarden berekenen. - - Er zijn geen locaties om een berekening voor uit te voeren. - MorphAn randvoorwaarden Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r2b5c91f2bd6369a53ab9e89915707f98ce553463 -r07a49c4b3a674477dde39e753bfab49ead03ae99 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsContextTreeNodeInfoTest.cs) (revision 2b5c91f2bd6369a53ab9e89915707f98ce553463) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsContextTreeNodeInfoTest.cs) (revision 07a49c4b3a674477dde39e753bfab49ead03ae99) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.Collections.Generic; using System.Drawing; using System.IO; @@ -86,7 +85,7 @@ // Assert Assert.IsNotNull(info.Text); - Assert.IsNotNull(info.ForeColor); + Assert.IsNull(info.ForeColor); Assert.IsNotNull(info.Image); Assert.IsNotNull(info.ContextMenuStrip); Assert.IsNull(info.EnsureVisibleOnCreate); @@ -139,50 +138,6 @@ } [Test] - public void ForeColor_CalculationsEmpty_ReturnGrayText() - { - // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - - var context = new DuneLocationCalculationsContext(new ObservableList(), - new DuneErosionFailureMechanism(), - assessmentSection, - () => 0.01, - "Category Boundary Name"); - - // Call - Color textColor = info.ForeColor(context); - - // Assert - Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), textColor); - } - - [Test] - public void ForeColor_WithCalculations_ReturnControlText() - { - // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - - var duneLocationCalculations = new ObservableList - { - new DuneLocationCalculation(new TestDuneLocation()) - }; - var context = new DuneLocationCalculationsContext(duneLocationCalculations, - new DuneErosionFailureMechanism(), - assessmentSection, - () => 0.01, - "Category Boundary Name"); - - // Call - Color textColor = info.ForeColor(context); - - // Assert - Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), textColor); - } - - [Test] public void ContextMenuStrip_Always_CallsBuilder() { // Setup @@ -269,54 +224,6 @@ } [Test] - public void ContextMenuStrip_NoDuneLocationCalculations_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - - using (var treeViewControl = new TreeViewControl()) - { - var assessmentSection = mocks.Stub(); - - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validFilePath, - Version = "1.0" - }); - - var failureMechanism = new DuneErosionFailureMechanism - { - Contribution = 10 - }; - - var builder = new CustomItemsOnlyContextMenuBuilder(); - var context = new DuneLocationCalculationsContext(new ObservableList(), - failureMechanism, - assessmentSection, - () => 0.01, - "Category Boundary Name"); - - var gui = mocks.Stub(); - gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(builder); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndex, - "Alles be&rekenen", - "Er zijn geen locaties om een berekening voor uit te voeren.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - } - } - } - - [Test] public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup