Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest.cs =================================================================== diff -u -re76f825d46c84e4de20cb664d0e3bfbf9646ae56 -r6d3c6a02f2fa74252b58a15592ec94785bd78c8a --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest.cs) (revision e76f825d46c84e4de20cb664d0e3bfbf9646ae56) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest.cs) (revision 6d3c6a02f2fa74252b58a15592ec94785bd78c8a) @@ -40,15 +40,18 @@ namespace Ringtoets.GrassCoverErosionOutwards.Plugin.Test.ViewInfos { [TestFixture] - public class GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest + public class GrassCoverErosionOutwardsWaveHeightLocationsViewInfoTest { - [TestCase] + [Test] public void Initialized_Always_DataTypeAndViewTypeAsExpected() { + // Setup using (var plugin = new GrassCoverErosionOutwardsPlugin()) { + // Call var info = GetInfo(plugin); + // Assert Assert.NotNull(info, "Expected a viewInfo definition for views with type {0}.", typeof(GrassCoverErosionOutwardsWaveHeightLocationsView)); Assert.AreEqual(typeof(GrassCoverErosionOutwardsWaveHeightLocationsContext), info.DataType); Assert.AreEqual(typeof(IEnumerable), info.ViewDataType); @@ -59,6 +62,30 @@ } [Test] + public void GetViewData_Always_ReturnWrappedDataInContext() + { + // Setup + var mockRepository = new MockRepository(); + IAssessmentSection assessmentSectionStub = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var expectedLocations = new ObservableList(); + + using (var plugin = new GrassCoverErosionOutwardsPlugin()) + { + var info = GetInfo(plugin); + + // Call + var locations = info.GetViewData(new GrassCoverErosionOutwardsWaveHeightLocationsContext(expectedLocations, assessmentSectionStub)); + + // Assert + Assert.AreSame(locations, expectedLocations); + } + + mockRepository.VerifyAll(); + } + + [Test] public void AfterCreate_Always_SetsExpectedProperties() { var mockRepository = new MockRepository(); @@ -88,7 +115,6 @@ mockRepository.VerifyAll(); } - [Test] public void CloseViewForData_ForMatchingAssessmentSection_ReturnsTrue() { @@ -188,15 +214,15 @@ var mocks = new MockRepository(); var assessmentSectionA = mocks.Stub(); var assessmentSectionB = mocks.Stub(); - + assessmentSectionA.Stub(a => a.GetFailureMechanisms()).Return(new[] { new GrassCoverErosionOutwardsFailureMechanism() }); assessmentSectionB.Stub(a => a.GetFailureMechanisms()).Return(new[] { new GrassCoverErosionOutwardsFailureMechanism() - }); + }); mocks.ReplayAll(); var grassCoverErosionOutwardsFailureMechanismContext = new GrassCoverErosionOutwardsFailureMechanismContext( @@ -263,4 +289,4 @@ return plugin.GetViewInfos().FirstOrDefault(vi => vi.ViewType == typeof(GrassCoverErosionOutwardsWaveHeightLocationsView)); } } -} +} \ No newline at end of file