Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs =================================================================== diff -u -r7a61196d689922cf6df102fb0d81c43267c7b22b -r2c4339dd2b2ab14a652ba543f43a377718250c00 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs (.../DesignWaterLevelLocationsViewInfoTest.cs) (revision 7a61196d689922cf6df102fb0d81c43267c7b22b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs (.../DesignWaterLevelLocationsViewInfoTest.cs) (revision 2c4339dd2b2ab14a652ba543f43a377718250c00) @@ -64,13 +64,15 @@ // Setup var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var view = new DesignWaterLevelLocationsView(); - // Call - var viewName = info.GetViewName(view, assessmentSection); + using (var view = new DesignWaterLevelLocationsView()) + { + // Call + var viewName = info.GetViewName(view, assessmentSection); - // Assert - Assert.AreEqual("Toetspeilen", viewName); + // Assert + Assert.AreEqual("Toetspeilen", viewName); + } mocks.VerifyAll(); } @@ -137,13 +139,11 @@ guiStub.Stub(g => g.ViewCommands).Return(mocks.Stub()); guiStub.Stub(g => g.MainWindow).Return(mocks.Stub()); guiStub.Stub(g => g.DocumentViewController).Return(mocks.Stub()); - mocks.ReplayAll(); var context = new DesignWaterLevelLocationsContext(assessmentSection); - var view = new DesignWaterLevelLocationsView(); - + using (var view = new DesignWaterLevelLocationsView()) using (var ringtoetsPlugin = new RingtoetsPlugin()) { info = ringtoetsPlugin.GetViewInfos().First(tni => tni.ViewType == typeof(DesignWaterLevelLocationsView)); @@ -157,6 +157,7 @@ Assert.IsInstanceOf(view.CalculationCommandHandler); Assert.AreSame(view.ApplicationSelection, guiStub); } + mocks.VerifyAll(); } }