Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r4fe11c4a270a7e56254082366223320f86d0f6c0 -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 4fe11c4a270a7e56254082366223320f86d0f6c0) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) @@ -669,8 +669,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - calculation.InputParameters.UseBreakWater = true; // Call @@ -727,8 +725,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - calculation.InputParameters.UseBreakWater = false; using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -768,7 +764,7 @@ var nodeData = new ClosingStructuresCalculationGroupContext( calculationGroup, null, new ClosingStructuresFailureMechanism(), assessmentSection); - + var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -778,8 +774,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -807,7 +801,7 @@ var nodeData = new ClosingStructuresCalculationGroupContext( calculationGroup, null, new ClosingStructuresFailureMechanism(), assessmentSection); - + var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -817,8 +811,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -873,8 +865,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -939,8 +929,6 @@ gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -953,7 +941,7 @@ } } } - + [Test] public void ContextMenuStrip_CalculationGroupWithCalculationsContainingIllustrationPoints_ContextMenuItemClearIllustrationPointsEnabled() { @@ -991,8 +979,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1035,8 +1021,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1096,8 +1080,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1164,8 +1146,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r0b69db9fa07e6bf41d1c6e5aa47bb7b7b9ec71d1 -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 0b69db9fa07e6bf41d1c6e5aa47bb7b7b9ec71d1) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) @@ -500,8 +500,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -534,8 +532,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -575,8 +571,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -622,8 +616,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -670,8 +662,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - ChangeDikeProfile(dikeProfile); // Call @@ -742,8 +732,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - ChangeDikeProfile(dikeProfile); using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -824,8 +812,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - ChangeDikeProfile(dikeProfile); using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -915,8 +901,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - ChangeDikeProfile(dikeProfile); using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -1316,8 +1300,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1355,8 +1337,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1411,8 +1391,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1477,8 +1455,6 @@ gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1627,8 +1603,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1699,8 +1673,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1768,8 +1740,6 @@ gui.Stub(g => g.MainWindow).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(groupContext, null, treeViewControl)) { // Call @@ -1853,8 +1823,6 @@ .Times(nrOfCalculators); mocks.ReplayAll(); - plugin.Gui = gui; - DialogBoxHandler = (name, wnd) => { // Expect an activity dialog which is automatically closed @@ -2030,15 +1998,11 @@ using (var treeViewControl = new TreeViewControl()) { var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - var mainWindow = mocks.Stub(); gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.MainWindow).Return(mocks.Stub()); gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); - mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -2090,16 +2054,11 @@ using (var treeViewControl = new TreeViewControl()) { var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - var mainWindow = mocks.Stub(); - gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.MainWindow).Return(mocks.Stub()); gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); - mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -2156,16 +2115,11 @@ using (var treeViewControl = new TreeViewControl()) { var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - var mainWindow = mocks.Stub(); - gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.MainWindow).Return(mocks.Stub()); gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); - mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { string expectedNewName = NamingHelper.GetUniqueName(failureMechanism.CalculationsGroup.Children, existingCalculationName, c => c.Name); Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r8b7fa9b31132e2e73edfec3202289852c40fbfeb -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 8b7fa9b31132e2e73edfec3202289852c40fbfeb) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) @@ -795,8 +795,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - calculation.InputParameters.UseBreakWater = true; // Call @@ -853,8 +851,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - calculation.InputParameters.UseBreakWater = false; using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -904,8 +900,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -943,8 +937,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -999,8 +991,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1065,8 +1055,6 @@ gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1117,8 +1105,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1161,8 +1147,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1222,8 +1206,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1290,8 +1272,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r0296d70dfb1eea7e37839cbe979d4ebf4a0a0f7b -r93c4c67fe1c358bd1670c4f9da7fe828d02218ac --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 0296d70dfb1eea7e37839cbe979d4ebf4a0a0f7b) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 93c4c67fe1c358bd1670c4f9da7fe828d02218ac) @@ -27,7 +27,6 @@ using Core.Common.Base; using Core.Common.Controls.DataGrid; using Core.Common.Controls.TreeView; -using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Gui.Commands; using Core.Common.Gui.ContextMenu; @@ -1082,8 +1081,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - calculation.InputParameters.UseBreakWater = true; // Call @@ -1140,8 +1137,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - calculation.InputParameters.UseBreakWater = false; using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -1191,8 +1186,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1230,8 +1223,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1286,8 +1277,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.StrictMock()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1352,8 +1341,6 @@ gui.Stub(g => g.ViewCommands).Return(viewCommands); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1404,8 +1391,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1448,8 +1433,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Call @@ -1509,8 +1492,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1577,8 +1558,6 @@ gui.Stub(g => g.ViewCommands).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // When @@ -1754,8 +1733,6 @@ .Times(nrOfCalculators); mocks.ReplayAll(); - plugin.Gui = gui; - DialogBoxHandler = (name, wnd) => { // Expect an activity dialog which is automatically closed @@ -1841,8 +1818,6 @@ gui.Stub(g => g.MainWindow).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(groupContext, null, treeViewControl)) { // Call @@ -1905,8 +1880,6 @@ gui.Stub(g => g.MainWindow).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - DialogBoxHandler = (name, wnd) => { var selectionDialog = (StructureSelectionDialog) new FormTester(name).TheObject; @@ -1965,8 +1938,6 @@ gui.Stub(g => g.MainWindow).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - DialogBoxHandler = (name, wnd) => { var selectionDialog = (StructureSelectionDialog) new FormTester(name).TheObject; @@ -2031,8 +2002,6 @@ gui.Stub(g => g.MainWindow).Return(mocks.Stub()); mocks.ReplayAll(); - plugin.Gui = gui; - DialogBoxHandler = (name, wnd) => { var selectionDialog = (StructureSelectionDialog) new FormTester(name).TheObject;