Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rea7fd6455177ea93f8419e6a29fc00d1d3167359 -rb7c9234daf5a52422362a7cb3fa1f46a86df63bb --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision ea7fd6455177ea93f8419e6a29fc00d1d3167359) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision b7c9234daf5a52422362a7cb3fa1f46a86df63bb) @@ -570,63 +570,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemCalculateAllAndValidateAllDisabledAndTooltipSet() - { - // Setup - using (var treeViewControl = new TreeViewControl()) - { - var pipingFailureMechanism = new PipingFailureMechanism(); - var assessmentSection = new AssessmentSectionStub(); - var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); - - assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] - { - hydraulicBoundaryLocation - }, true); - - var group = new CalculationGroup - { - Children = - { - PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(hydraulicBoundaryLocation) - } - }; - - var nodeData = new PipingCalculationGroupContext(group, - null, - Enumerable.Empty(), - Enumerable.Empty(), - pipingFailureMechanism, - assessmentSection); - - var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - - var gui = mocks.Stub(); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); - mocks.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, pipingFailureMechanism, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuCalculateAllIndexRootGroup, - "Alles be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - - TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuValidateAllIndexRootGroup, - "Alles &valideren", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.ValidateAllIcon, - false); - } - } - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllAndValidateAllEnabled() { // Setup @@ -1064,13 +1007,13 @@ hydraulicBoundaryLocation }, true); - PipingCalculationScenario validCalculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(hydraulicBoundaryLocation); - validCalculation.Name = "A"; - PipingCalculationScenario invalidCalculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithInvalidInput(); - invalidCalculation.Name = "B"; + PipingCalculationScenario calculationA = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(hydraulicBoundaryLocation); + calculationA.Name = "A"; + PipingCalculationScenario calculationB = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(hydraulicBoundaryLocation); + calculationB.Name = "B"; var childGroup = new CalculationGroup(); - childGroup.Children.Add(validCalculation); + childGroup.Children.Add(calculationA); var emptyChildGroup = new CalculationGroup(); @@ -1079,7 +1022,7 @@ group.Children.Add(childGroup); group.Children.Add(emptyChildGroup); - group.Children.Add(invalidCalculation); + group.Children.Add(calculationB); var nodeData = new PipingCalculationGroupContext(group, parentGroup, @@ -1111,11 +1054,29 @@ }; // Call - contextMenu.Items[contextMenuCalculateAllIndexNestedGroup].PerformClick(); + Action call = () => contextMenu.Items[contextMenuCalculateAllIndexNestedGroup].PerformClick(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + string[] msgs = messages.ToArray(); + Assert.AreEqual(12, msgs.Length); + Assert.AreEqual("Uitvoeren van berekening 'A' is gestart.", msgs[0]); + CalculationServiceTestHelper.AssertValidationStartMessage(msgs[1]); + CalculationServiceTestHelper.AssertValidationEndMessage(msgs[2]); + CalculationServiceTestHelper.AssertCalculationStartMessage(msgs[3]); + CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[4]); + Assert.AreEqual("Uitvoeren van berekening 'A' is gelukt.", msgs[5]); + + Assert.AreEqual("Uitvoeren van berekening 'B' is gestart.", msgs[6]); + CalculationServiceTestHelper.AssertValidationStartMessage(msgs[7]); + CalculationServiceTestHelper.AssertValidationEndMessage(msgs[8]); + CalculationServiceTestHelper.AssertCalculationStartMessage(msgs[9]); + CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[10]); + Assert.AreEqual("Uitvoeren van berekening 'B' is gelukt.", msgs[11]); + }); } } - - // Assert } [Test] @@ -1310,7 +1271,7 @@ new Point3D(5.0, -5.0, 0.0) }); - var surfaceLines = new[] + PipingSurfaceLine[] surfaceLines = { surfaceLine1, surfaceLine2 @@ -1424,7 +1385,7 @@ new Point3D(5.0, -5.0, 0.0) }); - var surfaceLines = new[] + PipingSurfaceLine[] surfaceLines = { surfaceLine1, surfaceLine2