Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs =================================================================== diff -u -rf5bac1f11df4ee4881109371c50120763e303642 -r1b9d535d0b4f21bd0adb64184e5273d8bf691c4e --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision f5bac1f11df4ee4881109371c50120763e303642) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 1b9d535d0b4f21bd0adb64184e5273d8bf691c4e) @@ -52,18 +52,22 @@ private const int locationIdColumnIndex = 2; private const int locationColumnIndex = 3; private const int locationWaveHeightColumnIndex = 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] @@ -279,7 +283,6 @@ var rows = dataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; - var mockRepository = new MockRepository(); var guiServiceMock = mockRepository.StrictMock(); var observer = mockRepository.StrictMock(); @@ -304,7 +307,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; @@ -327,7 +331,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]