Index: Riskeer/DuneErosion/test/Riskeer.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u -rf3100c3b45fd61f451a147c48df8e25affaaae4c -rf1849734c890d55aa4170f529c47b8f4b8af591c --- Riskeer/DuneErosion/test/Riskeer.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision f3100c3b45fd61f451a147c48df8e25affaaae4c) +++ Riskeer/DuneErosion/test/Riskeer.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision f1849734c890d55aa4170f529c47b8f4b8af591c) @@ -46,54 +46,60 @@ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(DuneErosionFailureMechanismSectionResultContext)); } - [TearDown] - public void TearDown() - { - plugin.Dispose(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { - // Assert - Assert.IsNotNull(info.Text); - Assert.IsNull(info.ForeColor); - Assert.IsNotNull(info.Image); - Assert.IsNotNull(info.ContextMenuStrip); - Assert.IsNull(info.EnsureVisibleOnCreate); - Assert.IsNull(info.ExpandOnCreate); - Assert.IsNull(info.ChildNodeObjects); - Assert.IsNull(info.CanRename); - Assert.IsNull(info.OnNodeRenamed); - Assert.IsNull(info.CanRemove); - Assert.IsNull(info.OnNodeRemoved); - Assert.IsNull(info.CanCheck); - Assert.IsNull(info.CheckedState); - Assert.IsNull(info.OnNodeChecked); - Assert.IsNull(info.CanDrag); - Assert.IsNull(info.CanDrop); - Assert.IsNull(info.CanInsert); - Assert.IsNull(info.OnDrop); + // Setup + using (plugin) + { + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.CheckedState); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } } [Test] public void Text_Always_ReturnsName() { - // Call - string text = info.Text(null); + // Setup + using (plugin) + { + // Call + string text = info.Text(null); - // Assert - Assert.AreEqual("Resultaat", text); + // Assert + Assert.AreEqual("Resultaat", text); + } } [Test] public void Image_Always_ReturnsFailureMechanismSectionResultIcon() { - // Call - Image image = info.Image(null); + // Setup + using (plugin) + { + // Call + Image image = info.Image(null); - // Assert - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + // Assert + TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + } } [Test] @@ -105,7 +111,7 @@ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); - using (plugin) // This is needed to prevent interference from mocks in dispose + using (plugin) using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/MicrostabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u -rc62bff4ec2aab16d09f765bd47b4fde9b36a2fd7 -rf1849734c890d55aa4170f529c47b8f4b8af591c --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/MicrostabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../MicrostabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision c62bff4ec2aab16d09f765bd47b4fde9b36a2fd7) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/MicrostabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../MicrostabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision f1849734c890d55aa4170f529c47b8f4b8af591c) @@ -46,54 +46,60 @@ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(MicrostabilityFailureMechanismSectionResultContext)); } - [TearDown] - public void TearDown() - { - plugin.Dispose(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { - // Assert - Assert.IsNotNull(info.Text); - Assert.IsNull(info.ForeColor); - Assert.IsNotNull(info.Image); - Assert.IsNotNull(info.ContextMenuStrip); - Assert.IsNull(info.EnsureVisibleOnCreate); - Assert.IsNull(info.ExpandOnCreate); - Assert.IsNull(info.ChildNodeObjects); - Assert.IsNull(info.CanRename); - Assert.IsNull(info.OnNodeRenamed); - Assert.IsNull(info.CanRemove); - Assert.IsNull(info.OnNodeRemoved); - Assert.IsNull(info.CanCheck); - Assert.IsNull(info.CheckedState); - Assert.IsNull(info.OnNodeChecked); - Assert.IsNull(info.CanDrag); - Assert.IsNull(info.CanDrop); - Assert.IsNull(info.CanInsert); - Assert.IsNull(info.OnDrop); + // Setup + using (plugin) + { + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.CheckedState); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } } [Test] public void Text_Always_ReturnsName() { - // Call - string text = info.Text(null); + // Setup + using (plugin) + { + // Call + string text = info.Text(null); - // Assert - Assert.AreEqual("Resultaat", text); + // Assert + Assert.AreEqual("Resultaat", text); + } } [Test] public void Image_Always_ReturnsFailureMechanismSectionResultIcon() { - // Call - Image image = info.Image(null); + // Setup + using (plugin) + { + // Call + Image image = info.Image(null); - // Assert - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + // Assert + TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + } } [Test] @@ -105,7 +111,7 @@ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); - using (plugin) // This is needed to prevent interference from mocks in dispose + using (plugin) using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/PipingStructureFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u -rcae86e85207fdc7bbdd45179588f5d3c56bac58f -rf1849734c890d55aa4170f529c47b8f4b8af591c --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/PipingStructureFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../PipingStructureFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision cae86e85207fdc7bbdd45179588f5d3c56bac58f) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/PipingStructureFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../PipingStructureFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision f1849734c890d55aa4170f529c47b8f4b8af591c) @@ -46,54 +46,60 @@ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(PipingStructureFailureMechanismSectionResultContext)); } - [TearDown] - public void TearDown() - { - plugin.Dispose(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { - // Assert - Assert.IsNotNull(info.Text); - Assert.IsNull(info.ForeColor); - Assert.IsNotNull(info.Image); - Assert.IsNotNull(info.ContextMenuStrip); - Assert.IsNull(info.EnsureVisibleOnCreate); - Assert.IsNull(info.ExpandOnCreate); - Assert.IsNull(info.ChildNodeObjects); - Assert.IsNull(info.CanRename); - Assert.IsNull(info.OnNodeRenamed); - Assert.IsNull(info.CanRemove); - Assert.IsNull(info.OnNodeRemoved); - Assert.IsNull(info.CanCheck); - Assert.IsNull(info.CheckedState); - Assert.IsNull(info.OnNodeChecked); - Assert.IsNull(info.CanDrag); - Assert.IsNull(info.CanDrop); - Assert.IsNull(info.CanInsert); - Assert.IsNull(info.OnDrop); + // Setup + using (plugin) + { + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.CheckedState); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } } [Test] public void Text_Always_ReturnsName() { - // Call - string text = info.Text(null); + // Setup + using (plugin) + { + // Call + string text = info.Text(null); - // Assert - Assert.AreEqual("Resultaat", text); + // Assert + Assert.AreEqual("Resultaat", text); + } } [Test] public void Image_Always_ReturnsFailureMechanismSectionResultIcon() { - // Call - Image image = info.Image(null); + // Setup + using (plugin) + { + // Call + Image image = info.Image(null); - // Assert - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + // Assert + TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + } } [Test] @@ -105,7 +111,7 @@ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); - using (plugin) // This is needed to prevent interference from mocks in dispose + using (plugin) using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterPressureAsphaltCoverFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u -r20e038bad82a79fa790358800fcbafd628e8c987 -rf1849734c890d55aa4170f529c47b8f4b8af591c --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterPressureAsphaltCoverFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision 20e038bad82a79fa790358800fcbafd628e8c987) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterPressureAsphaltCoverFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision f1849734c890d55aa4170f529c47b8f4b8af591c) @@ -46,54 +46,60 @@ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaterPressureAsphaltCoverFailureMechanismSectionResultContext)); } - [TearDown] - public void TearDown() - { - plugin.Dispose(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { - // Assert - Assert.IsNotNull(info.Text); - Assert.IsNull(info.ForeColor); - Assert.IsNotNull(info.Image); - Assert.IsNotNull(info.ContextMenuStrip); - Assert.IsNull(info.EnsureVisibleOnCreate); - Assert.IsNull(info.ExpandOnCreate); - Assert.IsNull(info.ChildNodeObjects); - Assert.IsNull(info.CanRename); - Assert.IsNull(info.OnNodeRenamed); - Assert.IsNull(info.CanRemove); - Assert.IsNull(info.OnNodeRemoved); - Assert.IsNull(info.CanCheck); - Assert.IsNull(info.CheckedState); - Assert.IsNull(info.OnNodeChecked); - Assert.IsNull(info.CanDrag); - Assert.IsNull(info.CanDrop); - Assert.IsNull(info.CanInsert); - Assert.IsNull(info.OnDrop); + // Setup + using (plugin) + { + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.CheckedState); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } } [Test] public void Text_Always_ReturnsName() { - // Call - string text = info.Text(null); + // Setup + using (plugin) + { + // Call + string text = info.Text(null); - // Assert - Assert.AreEqual("Resultaat", text); + // Assert + Assert.AreEqual("Resultaat", text); + } } [Test] public void Image_Always_ReturnsFailureMechanismSectionResultIcon() { - // Call - Image image = info.Image(null); + // Setup + using (plugin) + { + // Call + Image image = info.Image(null); - // Assert - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + // Assert + TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image); + } } [Test] @@ -105,7 +111,7 @@ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); - using (plugin) // This is needed to prevent interference from mocks in dispose + using (plugin) using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks);