Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs =================================================================== diff -u -r26bfb24de212c4f4224b773a0cb8fb87a2d7a0f0 -r6ecd02f5f7c642d5624f1e52f528c51b1bf5ab3a --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs (.../DesignWaterLevelLocationsViewInfoTest.cs) (revision 26bfb24de212c4f4224b773a0cb8fb87a2d7a0f0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs (.../DesignWaterLevelLocationsViewInfoTest.cs) (revision 6ecd02f5f7c642d5624f1e52f528c51b1bf5ab3a) @@ -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(); } }