Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsWaveConditionsCalculationContext.cs =================================================================== diff -u -ree395d64328db8f999b871e80491399a0a65e844 -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsWaveConditionsCalculationContext.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContext.cs) (revision ee395d64328db8f999b871e80491399a0a65e844) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsWaveConditionsCalculationContext.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContext.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -33,7 +33,7 @@ ICalculationContext { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The wrapped . /// The failure mechanism the calculation belongs to. Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r7e73b46787b05288e766f041ba935e20edf1eb93 -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 7e73b46787b05288e766f041ba935e20edf1eb93) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -225,7 +225,7 @@ } [Test] - public void CanRemove_CalculationNotInParent_ReturnTrue() + public void CanRemove_CalculationNotInParent_ReturnFalse() { // Setup var assessmentSection = mocks.Stub(); @@ -317,9 +317,9 @@ Output = null }; var foreshoreProfile = new ForeshoreProfile(new Point2D(0, 0), - Enumerable.Empty(), - new BreakWater(BreakWaterType.Caisson, 1), - new ForeshoreProfile.ConstructionProperties()); + Enumerable.Empty(), + new BreakWater(BreakWaterType.Caisson, 1), + new ForeshoreProfile.ConstructionProperties()); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism { @@ -329,22 +329,28 @@ } }; var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); + failureMechanism, + assessmentSection); // Call object[] children = info.ChildNodeObjects(context); // Assert Assert.AreEqual(3, children.Length); - var commentsContext = (CommentContext)children[0]; + var commentsContext = (CommentContext) children[0]; Assert.AreSame(calculation, commentsContext.WrappedData); - var inputContext = (WaveConditionsInputContext)children[1]; + var inputContext = (WaveConditionsInputContext) children[1]; Assert.AreSame(calculation.InputParameters, inputContext.WrappedData); - CollectionAssert.AreEqual(new[] { foreshoreProfile }, inputContext.ForeshoreProfiles); - CollectionAssert.AreEqual(new[] { location }, inputContext.HydraulicBoundaryLocations); + CollectionAssert.AreEqual(new[] + { + foreshoreProfile + }, inputContext.ForeshoreProfiles); + CollectionAssert.AreEqual(new[] + { + location + }, inputContext.HydraulicBoundaryLocations); Assert.IsInstanceOf(children[2]); } @@ -371,9 +377,9 @@ Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) }; var foreshoreProfile = new ForeshoreProfile(new Point2D(0, 0), - Enumerable.Empty(), - new BreakWater(BreakWaterType.Caisson, 1), - new ForeshoreProfile.ConstructionProperties()); + Enumerable.Empty(), + new BreakWater(BreakWaterType.Caisson, 1), + new ForeshoreProfile.ConstructionProperties()); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism { @@ -383,24 +389,30 @@ } }; var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); + failureMechanism, + assessmentSection); // Call object[] children = info.ChildNodeObjects(context); // Assert Assert.AreEqual(3, children.Length); - var commentsContext = (CommentContext)children[0]; + var commentsContext = (CommentContext) children[0]; Assert.AreSame(calculation, commentsContext.WrappedData); - var inputContext = (WaveConditionsInputContext)children[1]; + var inputContext = (WaveConditionsInputContext) children[1]; Assert.AreSame(calculation.InputParameters, inputContext.WrappedData); - CollectionAssert.AreEqual(new[] { foreshoreProfile }, inputContext.ForeshoreProfiles); - CollectionAssert.AreEqual(new[] { location }, inputContext.HydraulicBoundaryLocations); + CollectionAssert.AreEqual(new[] + { + foreshoreProfile + }, inputContext.ForeshoreProfiles); + CollectionAssert.AreEqual(new[] + { + location + }, inputContext.HydraulicBoundaryLocations); - var output = (GrassCoverErosionOutwardsWaveConditionsOutput)children[2]; + var output = (GrassCoverErosionOutwardsWaveConditionsOutput) children[2]; Assert.AreSame(calculation.Output, output); } @@ -600,7 +612,9 @@ } [Test] - public void GivenValidCalculation_WhenValidating_ThenCalculationPassesValidation() + [TestCase(true)] + [TestCase(false)] + public void GivenCalculation_WhenValidating_ThenCalculationValidated(bool validCalculation) { // Given string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, @@ -618,92 +632,22 @@ var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation { - Name = "A", - InputParameters = - { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) - { - DesignWaterLevel = (RoundedDouble) 12.0 - }, - LowerBoundaryRevetment = (RoundedDouble) 1.0, - UpperBoundaryRevetment = (RoundedDouble) 10.0, - StepSize = WaveConditionsInputStepSize.One, - LowerBoundaryWaterLevels = (RoundedDouble) 1.0, - UpperBoundaryWaterLevels = (RoundedDouble) 10.0 - } + Name = "A" }; - var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) + if (validCalculation) { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilderMock = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) + calculation.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) { - // Precondition - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - validateMenuItemIndex, - "&Valideren", - "Valideer de invoer voor deze berekening.", - RingtoetsCommonFormsResources.ValidateIcon); - - // When - ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); - - // Then - TestHelper.AssertLogMessages(call, logMessages => - { - var messages = logMessages.ToArray(); - Assert.AreEqual(2, messages.Length); - StringAssert.StartsWith("Validatie van 'A' gestart om: ", messages[0]); - StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages[1]); - }); - } + DesignWaterLevel = (RoundedDouble) 12.0 + }; + calculation.InputParameters.LowerBoundaryRevetment = (RoundedDouble) 1.0; + calculation.InputParameters.UpperBoundaryRevetment = (RoundedDouble) 10.0; + calculation.InputParameters.StepSize = WaveConditionsInputStepSize.One; + calculation.InputParameters.LowerBoundaryWaterLevels = (RoundedDouble) 1.0; + calculation.InputParameters.UpperBoundaryWaterLevels = (RoundedDouble) 10.0; } - } - [Test] - public void GivenInValidCalculation_WhenValidating_ThenCalculationFailsValidation() - { - // Given - string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, - Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); - - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = validHydroDatabasePath - }; - assessmentSection.Stub(a => a.Id).Return("someId"); - assessmentSection.Stub(a => a.FailureMechanismContribution).Return( - new FailureMechanismContribution(Enumerable.Empty(), 100, 20)); - - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation - { - Name = "A" - }; - var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, failureMechanism, assessmentSection); @@ -745,10 +689,16 @@ TestHelper.AssertLogMessages(call, logMessages => { var messages = logMessages.ToArray(); - Assert.AreEqual(3, messages.Length); + var expectedMessageCount = validCalculation ? 2 : 3; + Assert.AreEqual(expectedMessageCount, messages.Length); StringAssert.StartsWith("Validatie van 'A' gestart om: ", messages[0]); - StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", messages[1]); - StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages[2]); + + if (!validCalculation) + { + StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", messages[1]); + } + + StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages.Last()); }); } } @@ -803,68 +753,21 @@ } [Test] - public void GivenAssessmentSectionWithoutValidPathForCalculation_ThenCalculationItemDisabled() + [TestCase(true)] + [TestCase(false)] + public void AssessmentSection_WithOrWithoutValidPath_CalculationItemEnabledOrDisabled(bool validPath) { - // Given + // Setup var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + if (validPath) { - Name = "A" - }; - var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilderMock = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Then - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - calculateMenuItemIndex, - "Be&rekenen", - "Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. Fout bij het lezen van bestand '': Bestandspad mag niet leeg of ongedefinieerd zijn.", - RingtoetsCommonFormsResources.CalculateIcon, - false); - } + hydraulicBoundaryDatabase.FilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, + Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); } - } + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - [Test] - public void GivenAssessmentSectionWithValidPathForCalculation_ThenCalculationItemEnabled() - { - // Given - string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, - Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); - - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = validHydroDatabasePath - }; - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation { Name = "A" @@ -896,11 +799,15 @@ using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) { // Then + var expectedTooltip = validPath + ? "Voer deze berekening uit." + : "Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. Fout bij het lezen van bestand '': Bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertContextMenuStripContainsItem(contextMenu, calculateMenuItemIndex, "Be&rekenen", - "Voer deze berekening uit.", - RingtoetsCommonFormsResources.CalculateIcon); + expectedTooltip, + RingtoetsCommonFormsResources.CalculateIcon, + validPath); } } } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r2c68fa9dd748870624f45c0f2ae6a30327485a63 -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 2c68fa9dd748870624f45c0f2ae6a30327485a63) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -653,6 +653,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsClickOnValidateAllInGroup_ValidationMessagesLogged() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -711,8 +712,7 @@ assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - - // Setup + using (var treeViewControl = new TreeViewControl()) { var gui = mocks.Stub(); @@ -744,6 +744,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsClickOnCalculateAllInGroup_MessagesLogged() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -784,7 +785,6 @@ // Expect an activity dialog which is automatically closed }; - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -797,7 +797,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -823,6 +822,7 @@ [Test] public void ContextMenuStrip_NoCalculations_ClearAllOutputItemDisabled() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -847,7 +847,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -860,7 +859,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -876,6 +874,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsWithoutOutput_ClearAllOutputItemDisabled() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -904,7 +903,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -917,7 +915,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -935,6 +932,7 @@ [TestCase(false)] public void ContextMenuStrip_TwoCalculationsWithOutputClickOnClearAllOutput_OutputRemovedForCalculationsAfterConfirmation(bool confirm) { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -988,7 +986,6 @@ } }; - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -1001,7 +998,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PresentationObjects/StabilityStoneCoverWaveConditionsCalculationContext.cs =================================================================== diff -u -ree395d64328db8f999b871e80491399a0a65e844 -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PresentationObjects/StabilityStoneCoverWaveConditionsCalculationContext.cs (.../StabilityStoneCoverWaveConditionsCalculationContext.cs) (revision ee395d64328db8f999b871e80491399a0a65e844) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PresentationObjects/StabilityStoneCoverWaveConditionsCalculationContext.cs (.../StabilityStoneCoverWaveConditionsCalculationContext.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -26,7 +26,7 @@ namespace Ringtoets.StabilityStoneCover.Forms.PresentationObjects { /// - /// Presentation object for . + /// Presentation object for . /// public class StabilityStoneCoverWaveConditionsCalculationContext : StabilityStoneCoverContext, ICalculationContext Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -198,8 +198,14 @@ var inputContext = (WaveConditionsInputContext) children[1]; Assert.AreSame(calculation.InputParameters, inputContext.WrappedData); - CollectionAssert.AreEqual(new[] { foreshoreProfile }, inputContext.ForeshoreProfiles); - CollectionAssert.AreEqual(new[] { location }, inputContext.HydraulicBoundaryLocations); + CollectionAssert.AreEqual(new[] + { + foreshoreProfile + }, inputContext.ForeshoreProfiles); + CollectionAssert.AreEqual(new[] + { + location + }, inputContext.HydraulicBoundaryLocations); Assert.IsInstanceOf(children[2]); } @@ -227,9 +233,9 @@ Enumerable.Empty()) }; var foreshoreProfile = new ForeshoreProfile(new Point2D(0, 0), - Enumerable.Empty(), - new BreakWater(BreakWaterType.Caisson, 1), - new ForeshoreProfile.ConstructionProperties()); + Enumerable.Empty(), + new BreakWater(BreakWaterType.Caisson, 1), + new ForeshoreProfile.ConstructionProperties()); var failureMechanism = new StabilityStoneCoverFailureMechanism { @@ -253,8 +259,14 @@ var inputContext = (WaveConditionsInputContext) children[1]; Assert.AreSame(calculation.InputParameters, inputContext.WrappedData); - CollectionAssert.AreEqual(new[] { foreshoreProfile }, inputContext.ForeshoreProfiles); - CollectionAssert.AreEqual(new[] { location }, inputContext.HydraulicBoundaryLocations); + CollectionAssert.AreEqual(new[] + { + foreshoreProfile + }, inputContext.ForeshoreProfiles); + CollectionAssert.AreEqual(new[] + { + location + }, inputContext.HydraulicBoundaryLocations); var output = (StabilityStoneCoverWaveConditionsOutput) children[2]; Assert.AreSame(calculation.Output, output); @@ -332,7 +344,7 @@ } [Test] - public void CanRemove_CalculationNotInParent_ReturnTrue() + public void CanRemove_CalculationNotInParent_ReturnFalse() { // Setup var assessmentSection = mocks.Stub(); @@ -648,7 +660,9 @@ } [Test] - public void GivenValidCalculation_WhenValidating_ThenCalculationPassesValidation() + [TestCase(false)] + [TestCase(true)] + public void GivenCalculation_WhenValidating_ThenCalculationValidated(bool validCalculation) { // Given string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, @@ -666,92 +680,22 @@ var calculation = new StabilityStoneCoverWaveConditionsCalculation { - Name = "A", - InputParameters = - { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) - { - DesignWaterLevel = (RoundedDouble) 12.0 - }, - LowerBoundaryRevetment = (RoundedDouble) 1.0, - UpperBoundaryRevetment = (RoundedDouble) 10.0, - StepSize = WaveConditionsInputStepSize.One, - LowerBoundaryWaterLevels = (RoundedDouble) 1.0, - UpperBoundaryWaterLevels = (RoundedDouble) 10.0 - } + Name = "A" }; - var context = new StabilityStoneCoverWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) + if (validCalculation) { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilderMock = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) + calculation.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) { - // Precondition - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - validateMenuItemIndex, - "&Valideren", - "Valideer de invoer voor deze berekening.", - RingtoetsCommonFormsResources.ValidateIcon); - - // When - ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); - - // Then - TestHelper.AssertLogMessages(call, logMessages => - { - var messages = logMessages.ToArray(); - Assert.AreEqual(2, messages.Length); - StringAssert.StartsWith("Validatie van 'A' gestart om: ", messages[0]); - StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages[1]); - }); - } + DesignWaterLevel = (RoundedDouble) 12.0 + }; + calculation.InputParameters.LowerBoundaryRevetment = (RoundedDouble) 1.0; + calculation.InputParameters.UpperBoundaryRevetment = (RoundedDouble) 10.0; + calculation.InputParameters.StepSize = WaveConditionsInputStepSize.One; + calculation.InputParameters.LowerBoundaryWaterLevels = (RoundedDouble) 1.0; + calculation.InputParameters.UpperBoundaryWaterLevels = (RoundedDouble) 10.0; } - } - [Test] - public void GivenInValidCalculation_WhenValidating_ThenCalculationFailsValidation() - { - // Given - string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, - Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); - - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = validHydroDatabasePath - }; - assessmentSection.Stub(a => a.Id).Return("someId"); - assessmentSection.Stub(a => a.FailureMechanismContribution).Return( - new FailureMechanismContribution(Enumerable.Empty(), 100, 20)); - - var calculation = new StabilityStoneCoverWaveConditionsCalculation - { - Name = "A" - }; - var context = new StabilityStoneCoverWaveConditionsCalculationContext(calculation, failureMechanism, assessmentSection); @@ -793,10 +737,16 @@ TestHelper.AssertLogMessages(call, logMessages => { var messages = logMessages.ToArray(); - Assert.AreEqual(3, messages.Length); + var expectedMessageCount = validCalculation ? 2 : 3; + Assert.AreEqual(expectedMessageCount, messages.Length); StringAssert.StartsWith("Validatie van 'A' gestart om: ", messages[0]); - StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", messages[1]); - StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages[2]); + + if (!validCalculation) + { + StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", messages[1]); + } + + StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages.Last()); }); } } @@ -851,68 +801,21 @@ } [Test] - public void GivenAssessmentSectionWithoutValidPathForCalculation_ThenCalculationItemDisabled() + [TestCase(true)] + [TestCase(false)] + public void AssessmentSection_WithOrWithoutValidPath_CalculationItemEnabledOrDisabled(bool validPath) { - // Given + // Setup var failureMechanism = new StabilityStoneCoverFailureMechanism(); var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - - var calculation = new StabilityStoneCoverWaveConditionsCalculation + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + if (validPath) { - Name = "A" - }; - var context = new StabilityStoneCoverWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilderMock = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Then - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - calculateMenuItemIndex, - "Be&rekenen", - "Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. Fout bij het lezen van bestand '': Bestandspad mag niet leeg of ongedefinieerd zijn.", - RingtoetsCommonFormsResources.CalculateIcon, - false); - } + hydraulicBoundaryDatabase.FilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, + Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); } - } + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - [Test] - public void GivenAssessmentSectionWithValidPathForCalculation_ThenCalculationItemEnabled() - { - // Given - string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, - Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); - - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = validHydroDatabasePath - }; - var calculation = new StabilityStoneCoverWaveConditionsCalculation { Name = "A" @@ -944,11 +847,15 @@ using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) { // Then + var expectedTooltip = validPath + ? "Voer deze berekening uit." + : "Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. Fout bij het lezen van bestand '': Bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertContextMenuStripContainsItem(contextMenu, calculateMenuItemIndex, "Be&rekenen", - "Voer deze berekening uit.", - RingtoetsCommonFormsResources.CalculateIcon); + expectedTooltip, + RingtoetsCommonFormsResources.CalculateIcon, + validPath); } } } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r0f6049b15bcadf8de3a59c74e829f27bb725c013 -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 0f6049b15bcadf8de3a59c74e829f27bb725c013) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -656,6 +656,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsClickOnValidateAllInGroup_ValidationMessagesLogged() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -715,7 +716,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var gui = mocks.Stub(); @@ -747,6 +747,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsClickOnCalculateAllInGroup_MessagesLogged() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -787,7 +788,6 @@ // Expect an activity dialog which is automatically closed }; - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -800,7 +800,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -826,6 +825,7 @@ [Test] public void ContextMenuStrip_NoCalculations_ClearAllOutputItemDisabled() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -850,7 +850,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -863,7 +862,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -879,6 +877,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsWithoutOutput_ClearAllOutputItemDisabled() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -907,7 +906,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -920,7 +918,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -938,6 +935,7 @@ [TestCase(false)] public void ContextMenuStrip_TwoCalculationsWithOutputClickOnClearAllOutput_OutputRemovedForCalculationsAfterConfirmation(bool confirm) { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -996,7 +994,6 @@ } }; - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -1009,7 +1006,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r81245560212cc916b7e268e1f1dc240901d3a5ea -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 81245560212cc916b7e268e1f1dc240901d3a5ea) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -567,7 +567,9 @@ } [Test] - public void GivenValidCalculation_WhenValidating_ThenCalculationPassesValidation() + [TestCase(true)] + [TestCase(false)] + public void GivenCalculation_WhenValidating_ThenCalculationValidated(bool validCalculation) { // Given string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, @@ -590,95 +592,22 @@ var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation { - Name = "A", - InputParameters = - { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) - { - DesignWaterLevel = (RoundedDouble) 12.0 - }, - LowerBoundaryRevetment = (RoundedDouble) 1.0, - UpperBoundaryRevetment = (RoundedDouble) 10.0, - StepSize = WaveConditionsInputStepSize.One, - LowerBoundaryWaterLevels = (RoundedDouble) 1.0, - UpperBoundaryWaterLevels = (RoundedDouble) 10.0 - } + Name = "A" }; - var context = new WaveImpactAsphaltCoverWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); - using (var treeViewControl = new TreeViewControl()) + if (validCalculation) { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilderMock = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) + calculation.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 1, 1) { - // Precondition - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - validateMenuItemIndex, - "&Valideren", - "Valideer de invoer voor deze berekening.", - RingtoetsCommonFormsResources.ValidateIcon); - - // When - ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); - - // Then - TestHelper.AssertLogMessages(call, logMessages => - { - var messages = logMessages.ToArray(); - Assert.AreEqual(2, messages.Length); - StringAssert.StartsWith("Validatie van 'A' gestart om: ", messages[0]); - StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages[1]); - }); - } + DesignWaterLevel = (RoundedDouble) 12.0 + }; + calculation.InputParameters.LowerBoundaryRevetment = (RoundedDouble) 1.0; + calculation.InputParameters.UpperBoundaryRevetment = (RoundedDouble) 10.0; + calculation.InputParameters.StepSize = WaveConditionsInputStepSize.One; + calculation.InputParameters.LowerBoundaryWaterLevels = (RoundedDouble) 1.0; + calculation.InputParameters.UpperBoundaryWaterLevels = (RoundedDouble) 10.0; } - } - [Test] - public void GivenInValidCalculation_WhenValidating_ThenCalculationPassesValidation() - { - // Given - string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, - Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); - - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("A", new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - })); - var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = validHydroDatabasePath - }; - assessmentSection.Stub(a => a.Id).Return("someId"); - assessmentSection.Stub(a => a.FailureMechanismContribution).Return( - new FailureMechanismContribution(Enumerable.Empty(), 100, 20)); - - var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation - { - Name = "A" - }; var context = new WaveImpactAsphaltCoverWaveConditionsCalculationContext(calculation, failureMechanism, assessmentSection); @@ -720,10 +649,16 @@ TestHelper.AssertLogMessages(call, logMessages => { var messages = logMessages.ToArray(); - Assert.AreEqual(3, messages.Length); + var expectedMessageCount = validCalculation ? 2 : 3; + Assert.AreEqual(expectedMessageCount, messages.Length); StringAssert.StartsWith("Validatie van 'A' gestart om: ", messages[0]); - StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", messages[1]); - StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages[2]); + + if (!validCalculation) + { + StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", messages[1]); + } + + StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messages.Last()); }); } } @@ -778,68 +713,21 @@ } [Test] - public void GivenAssessmentSectionWithoutValidPathForCalculation_ThenCalculationItemDisabled() + [TestCase(true)] + [TestCase(false)] + public void AssessmentSection_WithOrWithoutValidPath_CalculationItemEnabledOrDisabled(bool validPath) { - // Given + // Setup var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - - var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + if (validPath) { - Name = "A" - }; - var context = new WaveImpactAsphaltCoverWaveConditionsCalculationContext(calculation, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilderMock = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilderMock); - - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Then - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - calculateMenuItemIndex, - "Be&rekenen", - "Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. Fout bij het lezen van bestand '': Bestandspad mag niet leeg of ongedefinieerd zijn.", - RingtoetsCommonFormsResources.CalculateIcon, - false); - } + hydraulicBoundaryDatabase.FilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, + Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); } - } + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - [Test] - public void GivenAssessmentSectionWithValidPathForCalculation_ThenCalculationItemEnabled() - { - // Given - string validHydroDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, - Path.Combine("HydraulicBoundaryLocationReader", "complete.sqlite")); - - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); - var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = validHydroDatabasePath - }; - var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation { Name = "A" @@ -871,11 +759,15 @@ using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) { // Then + var expectedTooltip = validPath + ? "Voer deze berekening uit." + : "Herstellen van de verbinding met de hydraulische randvoorwaardendatabase is mislukt. Fout bij het lezen van bestand '': Bestandspad mag niet leeg of ongedefinieerd zijn."; TestHelper.AssertContextMenuStripContainsItem(contextMenu, calculateMenuItemIndex, "Be&rekenen", - "Voer deze berekening uit.", - RingtoetsCommonFormsResources.CalculateIcon); + expectedTooltip, + RingtoetsCommonFormsResources.CalculateIcon, + validPath); } } } Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rca56897b34c8c3959cde8ebe5d02313bef0c84c6 -r86401a913aaf544979e4062d00acfe1fb24e1e4f --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision ca56897b34c8c3959cde8ebe5d02313bef0c84c6) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 86401a913aaf544979e4062d00acfe1fb24e1e4f) @@ -656,6 +656,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsClickOnValidateAllInGroup_ValidationMessagesLogged() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -715,7 +716,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var gui = mocks.Stub(); @@ -747,6 +747,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsClickOnCalculateAllInGroup_MessagesLogged() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -787,7 +788,6 @@ // Expect an activity dialog which is automatically closed }; - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -800,7 +800,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -826,6 +825,7 @@ [Test] public void ContextMenuStrip_NoCalculations_ClearAllOutputItemDisabled() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -850,7 +850,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -863,7 +862,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -879,6 +877,7 @@ [Test] public void ContextMenuStrip_TwoCalculationsWithoutOutput_ClearAllOutputItemDisabled() { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -907,7 +906,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -920,7 +918,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) { @@ -938,6 +935,7 @@ [TestCase(false)] public void ContextMenuStrip_TwoCalculationsWithOutputClickOnClearAllOutput_OutputRemovedForCalculationsAfterConfirmation(bool confirm) { + // Setup string hrdPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); var assessmentSection = mocks.Stub(); @@ -991,7 +989,6 @@ } }; - // Setup using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); @@ -1004,7 +1001,6 @@ plugin.Gui = gui; - using (new HydraRingCalculationServiceConfig()) using (new WaveConditionsCalculationServiceConfig()) using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) {