Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r4e6c8ac0eb663ddfe4565745fb4829a8432019e2 -rc9396d0af18873fda14c7e486decbfca7d4e8b21 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 4e6c8ac0eb663ddfe4565745fb4829a8432019e2) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision c9396d0af18873fda14c7e486decbfca7d4e8b21) @@ -67,9 +67,20 @@ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(HeightStructuresCalculationContext)); } + public override void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + + base.TearDown(); + } + [Test] public void Initialized_Always_ExpectedPropertiesSet() { + // Setup + mocks.ReplayAll(); + // Assert Assert.AreEqual(typeof(HeightStructuresCalculationContext), info.TagType); Assert.IsNotNull(info.Text); @@ -94,6 +105,9 @@ [Test] public void Image_Always_ReturnsCalculationIcon() { + // Setup + mocks.ReplayAll(); + // Call var image = info.Image(null); @@ -127,8 +141,6 @@ var emptyOutput = children[2] as EmptyProbabilityAssessmentOutput; Assert.IsNotNull(emptyOutput); - - mocks.VerifyAll(); } [Test] @@ -161,8 +173,6 @@ var output = children[2] as ProbabilityAssessmentOutput; Assert.IsNotNull(output); - - mocks.VerifyAll(); } [Test] @@ -203,7 +213,7 @@ info.ContextMenuStrip(nodeData, null, treeViewControl); } // Assert - mocks.VerifyAll(); // Expect no calls on arguments + // Assert expectancies are called in TearDown() } [Test] @@ -243,7 +253,6 @@ RingtoetsCommonFormsResources.ClearIcon, false); } - mocks.VerifyAll(); } [Test] @@ -275,7 +284,6 @@ RingtoetsCommonFormsResources.CalculateIcon, false); } - mocks.VerifyAll(); } [Test] @@ -314,7 +322,6 @@ RingtoetsCommonFormsResources.CalculateIcon, false); } - mocks.VerifyAll(); } [Test] @@ -354,7 +361,6 @@ TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.CalculateIcon, contextMenuItem.Image); Assert.IsFalse(contextMenuItem.Enabled); } - mocks.VerifyAll(); } [Test] @@ -400,7 +406,6 @@ RingtoetsCommonFormsResources.Calculate_ToolTip, RingtoetsCommonFormsResources.CalculateIcon); } - mocks.VerifyAll(); } [Test] @@ -480,7 +485,6 @@ Assert.IsNull(calculation.Output); } - mocks.VerifyAll(); } [Test] @@ -518,7 +522,6 @@ Assert.AreEqual(1, group.Children.Count); CollectionAssert.DoesNotContain(group.Children, elementToBeRemoved); - mocks.VerifyAll(); } private const int contextMenuCalculateIndex = 0;