Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -rf5bac1f11df4ee4881109371c50120763e303642 -r95c3452dca388375373dc915a0fd68acef51833b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision f5bac1f11df4ee4881109371c50120763e303642) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 95c3452dca388375373dc915a0fd68acef51833b) @@ -52,18 +52,22 @@ private const int locationIdColumnIndex = 2; private const int locationColumnIndex = 3; private const int locationDesignWaterlevelColumnIndex = 4; + private Form testForm; + private MockRepository mockRepository; [SetUp] public void Setup() { testForm = new Form(); + mockRepository = new MockRepository(); } [TearDown] public void TearDown() { testForm.Dispose(); + mockRepository.VerifyAll(); } [Test] @@ -284,7 +288,6 @@ var rows = dataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; - var mockRepository = new MockRepository(); var guiServiceMock = mockRepository.StrictMock(); var observer = mockRepository.StrictMock(); @@ -309,7 +312,8 @@ assessmentSectionStub.Stub(ass => ass.Id).Return(string.Empty); assessmentSectionStub.Stub(ass => ass.FailureMechanismContribution) .Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); - + assessmentSectionStub.Stub(a => a.Attach(null)).IgnoreArguments(); + assessmentSectionStub.Stub(a => a.Detach(null)).IgnoreArguments(); mockRepository.ReplayAll(); view.AssessmentSection = assessmentSectionStub; @@ -332,8 +336,6 @@ Assert.IsTrue((bool) rows[0].Cells[locationCalculateColumnIndex].Value); Assert.IsFalse((bool) rows[1].Cells[locationCalculateColumnIndex].Value); Assert.IsFalse((bool) rows[2].Cells[locationCalculateColumnIndex].Value); - - mockRepository.VerifyAll(); } [Test]