Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicBoundaryDatabasePropertyInfoTest.cs =================================================================== diff -u -rb36b927ea533f0dc445e9f762b407702d499ea29 -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicBoundaryDatabasePropertyInfoTest.cs (.../HydraulicBoundaryDatabasePropertyInfoTest.cs) (revision b36b927ea533f0dc445e9f762b407702d499ea29) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicBoundaryDatabasePropertyInfoTest.cs (.../HydraulicBoundaryDatabasePropertyInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -30,6 +30,7 @@ using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; using Riskeer.Integration.Forms.PropertyClasses; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.PropertyInfos { @@ -65,10 +66,8 @@ // Setup var mocks = new MockRepository(); var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.MainWindow).Return(mainWindow); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); plugin.Gui = gui; Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/NormContextPropertyInfoTest.cs =================================================================== diff -u -rb36b927ea533f0dc445e9f762b407702d499ea29 -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/NormContextPropertyInfoTest.cs (.../NormContextPropertyInfoTest.cs) (revision b36b927ea533f0dc445e9f762b407702d499ea29) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/NormContextPropertyInfoTest.cs (.../NormContextPropertyInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -31,6 +31,7 @@ using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Integration.Forms.PropertyClasses; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.PropertyInfos { @@ -59,10 +60,8 @@ var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); var viewCommands = mocks.Stub(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.ViewCommands).Return(viewCommands); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/StateRootContextPropertyInfoTest.cs =================================================================== diff -u -rb36b927ea533f0dc445e9f762b407702d499ea29 -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/StateRootContextPropertyInfoTest.cs (.../StateRootContextPropertyInfoTest.cs) (revision b36b927ea533f0dc445e9f762b407702d499ea29) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/StateRootContextPropertyInfoTest.cs (.../StateRootContextPropertyInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -30,6 +30,7 @@ using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; using Riskeer.Integration.Forms.PropertyClasses; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.PropertyInfos { @@ -58,10 +59,8 @@ var mocks = new MockRepository(); var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var viewCommands = mocks.Stub(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.ViewCommands).Return(viewCommands); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultCategoriesContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultCategoriesContextTreeNodeInfoTest.cs (.../AssemblyResultCategoriesContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultCategoriesContextTreeNodeInfoTest.cs (.../AssemblyResultCategoriesContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -31,6 +31,7 @@ using Riskeer.Common.Data.AssessmentSection; using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -121,9 +122,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultPerSectionContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultPerSectionContextTreeNodeInfoTest.cs (.../AssemblyResultPerSectionContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultPerSectionContextTreeNodeInfoTest.cs (.../AssemblyResultPerSectionContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -32,6 +32,7 @@ using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; using Riskeer.Integration.Plugin.Properties; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos { @@ -119,9 +120,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultPerSectionMapContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultPerSectionMapContextTreeNodeInfoTest.cs (.../AssemblyResultPerSectionMapContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultPerSectionMapContextTreeNodeInfoTest.cs (.../AssemblyResultPerSectionMapContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -32,6 +32,7 @@ using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; using Riskeer.Integration.Plugin.Properties; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos { @@ -119,9 +120,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultTotalContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultTotalContextTreeNodeInfoTest.cs (.../AssemblyResultTotalContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultTotalContextTreeNodeInfoTest.cs (.../AssemblyResultTotalContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -32,6 +32,7 @@ using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; using Riskeer.Integration.Plugin.Properties; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos { @@ -119,9 +120,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultsContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultsContextTreeNodeInfoTest.cs (.../AssemblyResultsContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyResultsContextTreeNodeInfoTest.cs (.../AssemblyResultsContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -31,6 +31,7 @@ using Riskeer.Common.Data.AssessmentSection; using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -122,9 +123,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionStateRootContextTreeNodeInfoTest.cs =================================================================== diff -u -r31512514d3f410f2f4e3d84879cc401f59423ebc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionStateRootContextTreeNodeInfoTest.cs (.../AssessmentSectionStateRootContextTreeNodeInfoTest.cs) (revision 31512514d3f410f2f4e3d84879cc401f59423ebc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionStateRootContextTreeNodeInfoTest.cs (.../AssessmentSectionStateRootContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -35,6 +35,7 @@ using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using CoreGuiResources = Core.Gui.Properties.Resources; using RiskeerIntegrationFormsResources = Riskeer.Integration.Forms.Properties.Resources; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; @@ -204,10 +205,8 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) @@ -235,10 +234,8 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var mocks = new MockRepository(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(assessmentSectionContext, treeView)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs =================================================================== diff -u -r886b86a66f072735567285a3489923186c236c32 -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs (.../BackgroundDataTreeNodeInfoTest.cs) (revision 886b86a66f072735567285a3489923186c236c32) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs (.../BackgroundDataTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -48,6 +48,7 @@ using Riskeer.Integration.Forms.Dialogs; using Riskeer.Integration.Forms.PresentationObjects; using Riskeer.Integration.Forms.Properties; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -216,10 +217,8 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mockRepository.ReplayAll(); using (var plugin = new RiskeerPlugin()) @@ -246,10 +245,8 @@ var assessmentSectionStateRootContext = new AssessmentSectionStateRootContext(new AssessmentSection(AssessmentSectionComposition.Dike)); using (var treeViewControl = new TreeViewControl()) { - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.Get(backgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mockRepository.ReplayAll(); using (var plugin = new RiskeerPlugin()) @@ -306,10 +303,8 @@ var viewCommands = mockRepository.Stub(); var mainWindow = mockRepository.Stub(); - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.MainWindow).Return(mainWindow); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(cmp => cmp.Get(backgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mockRepository.ReplayAll(); @@ -368,10 +363,8 @@ var viewCommands = mockRepository.Stub(); var mainWindow = mockRepository.Stub(); - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.MainWindow).Return(mainWindow); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(cmp => cmp.Get(backgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mockRepository.ReplayAll(); @@ -434,10 +427,8 @@ var viewCommands = mockRepository.Stub(); var mainWindow = mockRepository.Stub(); - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.MainWindow).Return(mainWindow); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(cmp => cmp.Get(newBackgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mockRepository.ReplayAll(); @@ -503,10 +494,8 @@ var viewCommands = mockRepository.Stub(); var mainWindow = mockRepository.Stub(); - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.MainWindow).Return(mainWindow); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(cmp => cmp.Get(newBackgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mockRepository.ReplayAll(); @@ -569,10 +558,8 @@ var viewCommands = mockRepository.Stub(); var mainWindow = mockRepository.Stub(); - var gui = mockRepository.Stub(); + IGui gui = StubFactory.CreateGuiStub(mockRepository); gui.Stub(g => g.MainWindow).Return(mainWindow); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.ViewCommands).Return(viewCommands); gui.Stub(cmp => cmp.Get(newBackgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mockRepository.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CalculationsStateRootContextTreeNodeInfoTest.cs =================================================================== diff -u -rcaf0cf2ad118a5ea9f0109176cbe31b94591f31e -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CalculationsStateRootContextTreeNodeInfoTest.cs (.../CalculationsStateRootContextTreeNodeInfoTest.cs) (revision caf0cf2ad118a5ea9f0109176cbe31b94591f31e) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CalculationsStateRootContextTreeNodeInfoTest.cs (.../CalculationsStateRootContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -36,6 +36,7 @@ using Riskeer.HeightStructures.Forms.PresentationObjects; using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using Riskeer.MacroStabilityInwards.Forms.PresentationObjects; using Riskeer.Piping.Forms.PresentationObjects; using Riskeer.StabilityPointStructures.Forms.PresentationObjects; @@ -215,10 +216,8 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) @@ -246,10 +245,8 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var mocks = new MockRepository(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CategoryTreeFolderTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CategoryTreeFolderTreeNodeInfoTest.cs (.../CategoryTreeFolderTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CategoryTreeFolderTreeNodeInfoTest.cs (.../CategoryTreeFolderTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -28,6 +28,7 @@ using NUnit.Framework; using Rhino.Mocks; using Riskeer.Common.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -212,9 +213,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(null, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CommentContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CommentContextTreeNodeInfoTest.cs (.../CommentContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/CommentContextTreeNodeInfoTest.cs (.../CommentContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -29,6 +29,7 @@ using NUnit.Framework; using Rhino.Mocks; using Riskeer.Common.Data; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -125,10 +126,8 @@ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); TreeNodeInfo info = GetInfo(plugin); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs (.../DikeProfileTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs (.../DikeProfileTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -29,6 +29,7 @@ using Rhino.Mocks; using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.TestUtil; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -109,9 +110,7 @@ menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); using (var treeViewControl = new TreeViewControl()) { Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailureMechanismAssemblyCategoriesContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailureMechanismAssemblyCategoriesContextTreeNodeInfoTest.cs (.../FailureMechanismAssemblyCategoriesContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailureMechanismAssemblyCategoriesContextTreeNodeInfoTest.cs (.../FailureMechanismAssemblyCategoriesContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -30,6 +30,7 @@ using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -122,10 +123,8 @@ menuBuilder.Expect(mb => mb.Build()).Return(null); } - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs (.../FailureMechanismSectionsContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs (.../FailureMechanismSectionsContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -31,6 +31,7 @@ using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -142,9 +143,7 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailurePathsStateRootContextTreeNodeInfoTest.cs =================================================================== diff -u -r9fdb69495467ae238eeabf8b237d0db546cf20b7 -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailurePathsStateRootContextTreeNodeInfoTest.cs (.../FailurePathsStateRootContextTreeNodeInfoTest.cs) (revision 9fdb69495467ae238eeabf8b237d0db546cf20b7) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailurePathsStateRootContextTreeNodeInfoTest.cs (.../FailurePathsStateRootContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -37,6 +37,7 @@ using Riskeer.HeightStructures.Forms.PresentationObjects; using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using Riskeer.MacroStabilityInwards.Forms.PresentationObjects; using Riskeer.Piping.Forms.PresentationObjects; using Riskeer.StabilityPointStructures.Forms.PresentationObjects; @@ -238,10 +239,8 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/ForeshoreProfileTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/ForeshoreProfileTreeNodeInfoTest.cs (.../ForeshoreProfileTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/ForeshoreProfileTreeNodeInfoTest.cs (.../ForeshoreProfileTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -30,6 +30,7 @@ using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.TestUtil; using Riskeer.Integration.Plugin.Properties; +using Riskeer.Integration.TestUtil; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos { @@ -113,9 +114,7 @@ menuBuilder.Expect(mb => mb.Build()).Return(null); } - var gui = mocks.Stub(); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + IGui gui = StubFactory.CreateGuiStub(mocks); using (var treeViewControl = new TreeViewControl()) { Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/ForeshoreProfilesContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/ForeshoreProfilesContextTreeNodeInfoTest.cs (.../ForeshoreProfilesContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/ForeshoreProfilesContextTreeNodeInfoTest.cs (.../ForeshoreProfilesContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -32,6 +32,7 @@ using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.PresentationObjects; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -207,10 +208,8 @@ contextMenuBuilder.Expect(b => b.Build()).Return(null); } - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(context, treeViewControl)).Return(contextMenuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); plugin.Gui = gui; Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GrassCoverSlipOffInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GrassCoverSlipOffInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GrassCoverSlipOffInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -37,6 +37,7 @@ using Riskeer.Integration.Data.StandAlone; using Riskeer.Integration.Data.StandAlone.SectionResults; using Riskeer.Integration.Forms.PresentationObjects.StandAlone; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -227,10 +228,8 @@ menuBuilder.Expect(mb => mb.Build()).Return(null); } - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); plugin.Gui = gui; @@ -267,10 +266,8 @@ menuBuilder.Expect(mb => mb.Build()).Return(null); } - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); plugin.Gui = gui; @@ -294,10 +291,8 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); plugin.Gui = gui; @@ -338,10 +333,8 @@ { var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.ViewCommands).Return(viewCommands); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.Get(failureMechanismContext, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); @@ -381,10 +374,8 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.ViewCommands).Return(viewCommands); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); gui.Stub(g => g.Get(failureMechanismContext, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GrassCoverSlipOffInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u -r48244f68eee25ef1d91701d82e4c4867f0252ffc -r94bb5674e5b28a8bafc4b07a57cedce20abeb76e --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GrassCoverSlipOffInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision 48244f68eee25ef1d91701d82e4c4867f0252ffc) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GrassCoverSlipOffInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision 94bb5674e5b28a8bafc4b07a57cedce20abeb76e) @@ -30,6 +30,7 @@ using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Integration.Data.StandAlone; using Riskeer.Integration.Data.StandAlone.SectionResults; +using Riskeer.Integration.TestUtil; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -118,10 +119,8 @@ using (plugin) using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); - gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll();