Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ScenarioSelectionControlTest.cs =================================================================== diff -u -rd39f2e1a0a36628bbd7751d426425d8f99b2b5af -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ScenarioSelectionControlTest.cs (.../ScenarioSelectionControlTest.cs) (revision d39f2e1a0a36628bbd7751d426425d8f99b2b5af) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/ScenarioSelectionControlTest.cs (.../ScenarioSelectionControlTest.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -56,7 +56,7 @@ using (var control = ShowScenariosControl()) { // Assert - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; var dataGridViewControl = (DataGridViewControl) new ControlTester("dataGridViewControl").TheObject; Assert.IsInstanceOf(control); @@ -67,8 +67,8 @@ Assert.AreEqual(0, dataGridView.RowCount); Assert.AreEqual(2, dataGridView.ColumnCount); - var sectionColumn = dataGridView.Columns[0]; - var calculationColumn = dataGridView.Columns[1]; + DataGridViewColumn sectionColumn = dataGridView.Columns[0]; + DataGridViewColumn calculationColumn = dataGridView.Columns[1]; Assert.AreEqual("Vak", sectionColumn.HeaderText); Assert.AreEqual("Berekening", calculationColumn.HeaderText); @@ -78,7 +78,7 @@ Assert.IsTrue(sectionColumn.ReadOnly); - DataGridViewComboBoxColumn comboBoxColumn = (DataGridViewComboBoxColumn) calculationColumn; + var comboBoxColumn = (DataGridViewComboBoxColumn) calculationColumn; Assert.AreEqual("WrappedObject", comboBoxColumn.ValueMember); Assert.AreEqual("DisplayName", comboBoxColumn.DisplayMember); } @@ -174,27 +174,35 @@ }); // Assert - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; Assert.AreEqual(2, dataGridView.RowCount); - DataGridViewComboBoxColumn comboBoxColumn = (DataGridViewComboBoxColumn) dataGridView.Columns[1]; + var comboBoxColumn = (DataGridViewComboBoxColumn) dataGridView.Columns[1]; Assert.AreEqual(2, comboBoxColumn.Items.Count); var cellA = (DataGridViewComboBoxCell) dataGridView[1, 0]; CollectionAssert.AreEqual( - new [] { "", calculationA.ToString() }, + new[] + { + "", + calculationA.ToString() + }, cellA.Items.OfType>().Select(r => r.DisplayName)); var cellB = (DataGridViewComboBoxCell) dataGridView[1, 1]; CollectionAssert.AreEqual( - new[] { "", calculationB.ToString() }, + new[] + { + "", + calculationB.ToString() + }, cellB.Items.OfType>().Select(r => r.DisplayName)); } mockRepository.VerifyAll(); } [Test] - public void ClearData_WithPreviousData_DataGridViewEmpty() + public void ClearDataSource_WithPreviousData_DataGridViewEmpty() { // Setup string sectionName = "sectionName"; @@ -237,7 +245,7 @@ public void EndEdit_DataGridViewInEditMode_DataGridViewNotInEditMode() { // Setup - string sectionName = "sectionName"; + const string sectionName = "sectionName"; var mockRepository = new MockRepository(); var calculation = mockRepository.Stub(); @@ -262,14 +270,14 @@ } }); - var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; // Make sure we can set edit mode programmatically in order for the test to work dataGridView.EditMode = DataGridViewEditMode.EditProgrammatically; dataGridView.CurrentCell = dataGridView[1, 0]; dataGridView.BeginEdit(false); - + // Precondition Assert.IsTrue(dataGridView.IsCurrentCellInEditMode, "Current cell should be in edit mode before EndEdit is called."); @@ -290,17 +298,17 @@ return control; } - } - public class EditableScenarioRow : IScenarioRow - { - public EditableScenarioRow(ICalculation calculation, string sectionName) + private class EditableScenarioRow : IScenarioRow { - Name = sectionName; - Calculation = calculation; - } + public EditableScenarioRow(ICalculation calculation, string sectionName) + { + Name = sectionName; + Calculation = calculation; + } - public string Name { get; private set; } - public ICalculation Calculation { get; set; } + public string Name { get; private set; } + public ICalculation Calculation { get; set; } + } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Utils.Test/AssignUnassignCalculationsTest.cs =================================================================== diff -u -r38600213ce6ca43c1819c81dd95c8ce786650ac3 -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/Common/test/Ringtoets.Common.Utils.Test/AssignUnassignCalculationsTest.cs (.../AssignUnassignCalculationsTest.cs) (revision 38600213ce6ca43c1819c81dd95c8ce786650ac3) +++ Ringtoets/Common/test/Ringtoets.Common.Utils.Test/AssignUnassignCalculationsTest.cs (.../AssignUnassignCalculationsTest.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -117,7 +117,7 @@ } [Test] - public void Update_CalculationDikeProfileChangedToMatchOtherSection_FirstSectionResultCalculationNullSecondSectionResultCalculationSet() + public void Update_CalculationLocationChangedToMatchOtherSection_FirstSectionResultCalculationNullSecondSectionResultCalculationSet() { // Setup var mockRepository = new MockRepository(); @@ -159,7 +159,7 @@ } [Test] - public void Update_CalculationDikeProfileChangedToMatchOtherSection_FirstSectionResultCalculationNullSecondSectionResultCalculationUnchanged() + public void Update_CalculationCalculationChangedToMatchOtherSection_FirstSectionResultCalculationNullSecondSectionResultCalculationUnchanged() { // Setup var mockRepository = new MockRepository(); @@ -329,7 +329,6 @@ }; sectionResult.Calculation = calculation; - // Setup // Call AssignUnassignCalculations.Delete(sectionResults, calculation, Enumerable.Empty()); @@ -502,7 +501,7 @@ } [Test] - public void FailureMechanismSectionForCalculation_NullSectionsElement_ThrowsArgumentNullException() + public void FailureMechanismSectionForCalculation_NullSectionsElement_ThrowsArgumentException() { // Call TestDelegate call = () => AssignUnassignCalculations.FailureMechanismSectionForCalculation( @@ -598,11 +597,11 @@ new CalculationWithLocation(mockRepository.Stub(), new Point2D(50.0, 66.0)) }; } - } - public class FailureMechanismSectionResultWithCalculation : FailureMechanismSectionResult - { - public FailureMechanismSectionResultWithCalculation(FailureMechanismSection section) : base(section) {} - public ICalculation Calculation { get; set; } + private class FailureMechanismSectionResultWithCalculation : FailureMechanismSectionResult + { + public FailureMechanismSectionResultWithCalculation(FailureMechanismSection section) : base(section) {} + public ICalculation Calculation { get; set; } + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs =================================================================== diff -u -r38600213ce6ca43c1819c81dd95c8ce786650ac3 -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision 38600213ce6ca43c1819c81dd95c8ce786650ac3) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsScenariosView.cs (.../GrassCoverErosionInwardsScenariosView.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -127,13 +127,13 @@ { var calculations = data.GetCalculations(); - Dictionary> caculationsPerSegment = + Dictionary> calculationsPerSegment = GrassCoverErosionInwardsHelper.CollectCalculationsPerSection(failureMechanism.Sections, calculations.OfType()); List scenarioRows = FailureMechanism.SectionResults.Select(sectionResult => new GrassCoverErosionInwardsScenarioRow(sectionResult)).ToList(); - scenarioSelectionControl.UpdateDataGridViewDataSource(calculations, scenarioRows, caculationsPerSegment); + scenarioSelectionControl.UpdateDataGridViewDataSource(calculations, scenarioRows, calculationsPerSegment); } } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Utils/GrassCoverErosionInwardsHelper.cs =================================================================== diff -u -r5d503cf8885ced4799e5ad44242038d99e04b162 -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Utils/GrassCoverErosionInwardsHelper.cs (.../GrassCoverErosionInwardsHelper.cs) (revision 5d503cf8885ced4799e5ad44242038d99e04b162) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Utils/GrassCoverErosionInwardsHelper.cs (.../GrassCoverErosionInwardsHelper.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -65,15 +65,15 @@ /// Returns the closest to or null if the /// has no location. /// Thrown when is null - /// Thrown when an element in is null. + /// Thrown when an element in is null. /// public static FailureMechanismSection FailureMechanismSectionForCalculation(IEnumerable sections, GrassCoverErosionInwardsCalculation calculation) { - var asCalculationWithLocation = AsCalculationWithLocation(calculation); - if (asCalculationWithLocation != null) + CalculationWithLocation calculationWithLocation = AsCalculationWithLocation(calculation); + if (calculationWithLocation != null) { - return AssignUnassignCalculations.FailureMechanismSectionForCalculation(sections, asCalculationWithLocation); + return AssignUnassignCalculations.FailureMechanismSectionForCalculation(sections, calculationWithLocation); } return null; } @@ -85,18 +85,18 @@ /// The of to iterate while /// possibly updating the assigned to it. /// The which has a location that has been updated. - /// When is null + /// Thrown when is null /// Thrown when element in is /// null. public static void Update(IEnumerable sectionResults, GrassCoverErosionInwardsCalculation calculation) { ValidateSectionResults(sectionResults); - var asCalculationWithLocation = AsCalculationWithLocation(calculation); - if (asCalculationWithLocation != null) + CalculationWithLocation calculationWithLocation = AsCalculationWithLocation(calculation); + if (calculationWithLocation != null) { - AssignUnassignCalculations.Update(sectionResults.Select(AsCalculationAssignment), asCalculationWithLocation); + AssignUnassignCalculations.Update(sectionResults.Select(AsCalculationAssignment), calculationWithLocation); } } @@ -109,7 +109,7 @@ /// The which has a location that has been updated. /// The of that were left after removing /// . - /// When any input parameter is null or when an element + /// Thrown when any input parameter is null or when an element /// in is null. /// Thrown when element in is /// null. @@ -158,8 +158,7 @@ /// Transforms the into a . /// /// The to transform. - /// A new or null if the calculation had no value - /// or had no dike profile assigned. + /// A new or null if the calculation had no dike profile assigned. /// Thrown when is null. private static CalculationWithLocation AsCalculationWithLocation(GrassCoverErosionInwardsCalculation calculation) { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rfda32224be20ced8ee871a3ab495f11e55d48835 -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision fda32224be20ced8ee871a3ab495f11e55d48835) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -46,7 +46,6 @@ using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Plugin; using Ringtoets.HydraRing.Data; -using GrassCoverErosionInwardsFormsResources = Ringtoets.GrassCoverErosionInwards.Forms.Properties.Resources; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using RingtoetsCommonServiceResources = Ringtoets.Common.Service.Properties.Resources; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs =================================================================== diff -u -r5d503cf8885ced4799e5ad44242038d99e04b162 -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs (.../GrassCoverErosionInwardsHelperTest.cs) (revision 5d503cf8885ced4799e5ad44242038d99e04b162) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs (.../GrassCoverErosionInwardsHelperTest.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -37,54 +37,6 @@ private const string firstSectionName = "firstSection"; private const string secondSectionName = "secondSection"; - #region Prepared data - - private static readonly FailureMechanismSection failureMechanismSectionA = new FailureMechanismSection(firstSectionName, new List - { - new Point2D(0.0, 0.0), - new Point2D(10.0, 10.0), - }); - - private static readonly FailureMechanismSection failureMechanismSectionB = new FailureMechanismSection(secondSectionName, new List - { - new Point2D(11.0, 11.0), - new Point2D(100.0, 100.0), - }); - - private static readonly GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult( - failureMechanismSectionA); - - private readonly FailureMechanismSection[] oneSection = - { - failureMechanismSectionA - }; - - private readonly FailureMechanismSection[] twoSections = - { - failureMechanismSectionA, - failureMechanismSectionB - }; - - private readonly GrassCoverErosionInwardsCalculation calculationInSectionA = new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - DikeProfile = new DikeProfile(new Point2D(1.1, 2.2), new RoughnessPoint[0], new Point2D[0], null, - new DikeProfile.ConstructionProperties()) - } - }; - - private readonly GrassCoverErosionInwardsCalculation calculationInSectionB = new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - DikeProfile = new DikeProfile(new Point2D(50.0, 66.0), new RoughnessPoint[0], new Point2D[0], - null, new DikeProfile.ConstructionProperties()) - } - }; - - #endregion - [Test] public void CollectCalculationsPerSection_SectionsAreNull_ThrowsArgumentNullException() { @@ -128,7 +80,7 @@ TestDelegate test = () => GrassCoverErosionInwardsHelper.CollectCalculationsPerSection( twoSections, null); - + // Assert var exception = Assert.Throws(test); Assert.AreEqual("calculations", exception.ParamName); @@ -144,7 +96,7 @@ { null }); - + // Assert var exception = Assert.Throws(test); Assert.AreEqual("calculation", exception.ParamName); @@ -254,7 +206,6 @@ Assert.AreSame(twoSections[1], failureMechanismSection); } - [Test] public void Update_SectionResultsNull_ThrowsArgumentNullException() { @@ -287,13 +238,33 @@ } [Test] + public void Update_SectionResultWithoutCalculationAndValidCalculation_UpdatesSectionResult() + { + // Setup + var failureMechanismSectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult( + failureMechanismSectionA); + + // Call + GrassCoverErosionInwardsHelper.Update(new[] + { + failureMechanismSectionResult + }, calculationInSectionA); + + // Assert + Assert.AreSame(calculationInSectionA, failureMechanismSectionResult.Calculation); + } + + [Test] public void Delete_SectionResultsNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => GrassCoverErosionInwardsHelper.Delete( null, calculationInSectionA, - new [] { calculationInSectionB }); + new[] + { + calculationInSectionB + }); // Assert var exception = Assert.Throws(test); @@ -311,7 +282,10 @@ null }, calculationInSectionA, - new [] { calculationInSectionB }); + new[] + { + calculationInSectionB + }); // Assert ArgumentException exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage( @@ -329,7 +303,10 @@ sectionResult }, null, - new[] { calculationInSectionA }); + new[] + { + calculationInSectionA + }); // Assert var exception = Assert.Throws(test); @@ -363,10 +340,111 @@ sectionResult }, calculationInSectionA, - new GrassCoverErosionInwardsCalculation[] { null }); + new GrassCoverErosionInwardsCalculation[] + { + null + }); // Assert var exception = Assert.Throws(test); Assert.AreEqual("calculation", exception.ParamName); - } } + } + + [Test] + public void Delete_SectionResultWithCalculationNoRemainingCalculations_SectionResultCalculationIsNull() + { + // Setup + var failureMechanismSectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult( + failureMechanismSectionA) + { + Calculation = calculationInSectionA + }; + + // Call + GrassCoverErosionInwardsHelper.Delete( + new[] + { + failureMechanismSectionResult + }, + calculationInSectionA, + Enumerable.Empty()); + + // Assert + Assert.IsNull(failureMechanismSectionResult.Calculation); + } + + [Test] + public void Delete_SectionResultWithCalculationWithRemainingCalculations_SectionResultCalculationSetToRemainingCalculation() + { + // Setup + var failureMechanismSectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult( + failureMechanismSectionA) + { + Calculation = calculationInSectionA + }; + + // Call + GrassCoverErosionInwardsHelper.Delete( + new[] + { + failureMechanismSectionResult + }, + calculationInSectionA, + new[] + { + calculationInSectionB + }); + + // Assert + Assert.AreSame(calculationInSectionB, failureMechanismSectionResult.Calculation); + } + + #region Prepared data + + private static readonly FailureMechanismSection failureMechanismSectionA = new FailureMechanismSection(firstSectionName, new List + { + new Point2D(0.0, 0.0), + new Point2D(10.0, 10.0), + }); + + private static readonly FailureMechanismSection failureMechanismSectionB = new FailureMechanismSection(secondSectionName, new List + { + new Point2D(11.0, 11.0), + new Point2D(100.0, 100.0), + }); + + private static readonly GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult( + failureMechanismSectionA); + + private readonly FailureMechanismSection[] oneSection = + { + failureMechanismSectionA + }; + + private readonly FailureMechanismSection[] twoSections = + { + failureMechanismSectionA, + failureMechanismSectionB + }; + + private readonly GrassCoverErosionInwardsCalculation calculationInSectionA = new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + DikeProfile = new DikeProfile(new Point2D(1.1, 2.2), new RoughnessPoint[0], new Point2D[0], null, + new DikeProfile.ConstructionProperties()) + } + }; + + private readonly GrassCoverErosionInwardsCalculation calculationInSectionB = new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + DikeProfile = new DikeProfile(new Point2D(50.0, 66.0), new RoughnessPoint[0], new Point2D[0], + null, new DikeProfile.ConstructionProperties()) + } + }; + + #endregion + } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r93d214db8ac0a90b6f1bf1712a414e4f31c3eed9 -r1b1417a8dc33bc6b1e0b33c71d9318544c3daa73 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 93d214db8ac0a90b6f1bf1712a414e4f31c3eed9) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 1b1417a8dc33bc6b1e0b33c71d9318544c3daa73) @@ -73,6 +73,17 @@ private const int contextMenuCalculateAllIndexNestedGroup = 6; private const int contextMenuClearOutputNestedGroupIndex = 7; + private const string expectedTextExpandAll = "Alles ui&tklappen"; + private const string expectedTextExpandAllToolTip = "Klap dit element en alle onderliggende elementen uit."; + private const string expectedTextRename = "&Hernoemen"; + private const string expectedTextRenameToolTip = "Wijzig de naam van dit element."; + private const string expectedTextDelete = "Verwij&deren..."; + private const string expectedTextDeleteToolTip = "Verwijder dit element uit de boom."; + private const string expectedTextCollapseAll = "Alles i&nklappen"; + private const string expectedTextCollapseAllToolTip = "Klap dit element en alle onderliggende elementen in."; + private const string expectedTextProperties = "Ei&genschappen"; + private const string expectedTextPropertiesToolTip = "Toon de eigenschappen in het Eigenschappenpaneel."; + private MockRepository mocks; private GrassCoverErosionOutwardsPlugin plugin; private TreeNodeInfo info; @@ -244,25 +255,24 @@ Assert.AreEqual(16, menu.Items.Count); TestHelper.AssertContextMenuStripContainsItem(menu, 0, - CoreCommonGuiResources.Export, - CoreCommonGuiResources.Export_ToolTip, + "&Exporteren...", + "Exporteer de gegevens naar een bestand.", CoreCommonGuiResources.ExportIcon); - TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexNestedGroup, - RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + "&Map toevoegen", "Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap.", RingtoetsCommonFormsResources.AddFolderIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexNestedGroup, - RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, + "Berekening &toevoegen", "Voeg een nieuwe berekening toe aan deze berekeningsmap.", RingtoetsCommonFormsResources.FailureMechanismIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexNestedGroup, - RingtoetsCommonFormsResources.Validate_all, + "Alles &valideren", "Er zijn geen berekeningen om te valideren.", RingtoetsCommonFormsResources.ValidateAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexNestedGroup, - RingtoetsCommonFormsResources.Calculate_all, + "Alles be&rekenen", "Er zijn geen berekeningen om uit te voeren.", RingtoetsCommonFormsResources.CalculateAllIcon, false); @@ -271,30 +281,27 @@ "Er zijn geen berekeningen met uitvoer om te wissen.", RingtoetsCommonFormsResources.ClearIcon, false); - TestHelper.AssertContextMenuStripContainsItem(menu, 9, - CoreCommonGuiResources.Rename, - CoreCommonGuiResources.Rename_ToolTip, + expectedTextRename, + expectedTextRenameToolTip, CoreCommonGuiResources.RenameIcon); TestHelper.AssertContextMenuStripContainsItem(menu, 10, - CoreCommonGuiResources.Delete, - CoreCommonGuiResources.Delete_ToolTip, + expectedTextDelete, + expectedTextDeleteToolTip, CoreCommonGuiResources.DeleteIcon); - TestHelper.AssertContextMenuStripContainsItem(menu, 12, - CoreCommonGuiResources.Expand_all, - CoreCommonGuiResources.Expand_all_ToolTip, + expectedTextExpandAll, + expectedTextExpandAllToolTip, CoreCommonGuiResources.ExpandAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, 13, - CoreCommonGuiResources.Collapse_all, - CoreCommonGuiResources.Collapse_all_ToolTip, + expectedTextCollapseAll, + expectedTextCollapseAllToolTip, CoreCommonGuiResources.CollapseAllIcon, false); - TestHelper.AssertContextMenuStripContainsItem(menu, 15, - CoreCommonGuiResources.Properties, - CoreCommonGuiResources.Properties_ToolTip, + expectedTextProperties, + expectedTextPropertiesToolTip, CoreCommonGuiResources.PropertiesHS, false); @@ -352,11 +359,11 @@ "Er is geen hydraulische randvoorwaardendatabase beschikbaar om de randvoorwaardenberekeningen te genereren.", RingtoetsCommonFormsResources.GenerateScenariosIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexRootGroup, - RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + "&Map toevoegen", "Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap.", RingtoetsCommonFormsResources.AddFolderIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexRootGroup, - RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, + "Berekening &toevoegen", "Voeg een nieuwe berekening toe aan deze berekeningsmap.", RingtoetsCommonFormsResources.FailureMechanismIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRemoveAllChildrenIndexRootGroup, @@ -365,12 +372,12 @@ CoreCommonGuiResources.DeleteChildrenIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexRootGroup, - RingtoetsCommonFormsResources.Validate_all, + "Alles &valideren", "Er zijn geen berekeningen om te valideren.", RingtoetsCommonFormsResources.ValidateAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup, - RingtoetsCommonFormsResources.Calculate_all, + "Alles be&rekenen", "Er zijn geen berekeningen om uit te voeren.", RingtoetsCommonFormsResources.CalculateAllIcon, false); @@ -380,18 +387,18 @@ RingtoetsCommonFormsResources.ClearIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuExpandAllIndexRootGroup, - CoreCommonGuiResources.Expand_all, - CoreCommonGuiResources.Expand_all_ToolTip, + expectedTextExpandAll, + expectedTextExpandAllToolTip, CoreCommonGuiResources.ExpandAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCollapseAllIndexRootGroup, - CoreCommonGuiResources.Collapse_all, - CoreCommonGuiResources.Collapse_all_ToolTip, + expectedTextCollapseAll, + expectedTextCollapseAllToolTip, CoreCommonGuiResources.CollapseAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuPropertiesIndexRootGroup, - CoreCommonGuiResources.Properties, - CoreCommonGuiResources.Properties_ToolTip, + expectedTextProperties, + expectedTextPropertiesToolTip, CoreCommonGuiResources.PropertiesHS, false); CollectionAssert.AllItemsAreInstancesOfType(new[] @@ -455,11 +462,11 @@ "Genereer randvoorwaardenberekeningen.", RingtoetsCommonFormsResources.GenerateScenariosIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexRootGroup, - RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + "&Map toevoegen", "Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap.", RingtoetsCommonFormsResources.AddFolderIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexRootGroup, - RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, + "Berekening &toevoegen", "Voeg een nieuwe berekening toe aan deze berekeningsmap.", RingtoetsCommonFormsResources.FailureMechanismIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRemoveAllChildrenIndexRootGroup, @@ -468,12 +475,12 @@ CoreCommonGuiResources.DeleteChildrenIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexRootGroup, - RingtoetsCommonFormsResources.Validate_all, + "Alles &valideren", "Er zijn geen berekeningen om te valideren.", RingtoetsCommonFormsResources.ValidateAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup, - RingtoetsCommonFormsResources.Calculate_all, + "Alles be&rekenen", "Er zijn geen berekeningen om uit te voeren.", RingtoetsCommonFormsResources.CalculateAllIcon, false); @@ -483,18 +490,18 @@ RingtoetsCommonFormsResources.ClearIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuExpandAllIndexRootGroup, - CoreCommonGuiResources.Expand_all, - CoreCommonGuiResources.Expand_all_ToolTip, + expectedTextExpandAll, + expectedTextExpandAllToolTip, CoreCommonGuiResources.ExpandAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCollapseAllIndexRootGroup, - CoreCommonGuiResources.Collapse_all, - CoreCommonGuiResources.Collapse_all_ToolTip, + expectedTextCollapseAll, + expectedTextCollapseAllToolTip, CoreCommonGuiResources.CollapseAllIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuPropertiesIndexRootGroup, - CoreCommonGuiResources.Properties, - CoreCommonGuiResources.Properties_ToolTip, + expectedTextProperties, + expectedTextPropertiesToolTip, CoreCommonGuiResources.PropertiesHS, false); CollectionAssert.AllItemsAreInstancesOfType(new[]