Index: Core/Plugins/src/Core.Plugins.Map/PresentationObjects/MapDataContext.cs =================================================================== diff -u -red92d5353ea8138720874c61c353fd70fd12d3d0 -r7b3ee0978809b7e423487a599c3ded787efeeefe --- Core/Plugins/src/Core.Plugins.Map/PresentationObjects/MapDataContext.cs (.../MapDataContext.cs) (revision ed92d5353ea8138720874c61c353fd70fd12d3d0) +++ Core/Plugins/src/Core.Plugins.Map/PresentationObjects/MapDataContext.cs (.../MapDataContext.cs) (revision 7b3ee0978809b7e423487a599c3ded787efeeefe) @@ -28,7 +28,7 @@ /// /// Presentation object for . /// - public class MapDataContext : ObservableWrappedObjectContextBase + public abstract class MapDataContext : ObservableWrappedObjectContextBase { /// /// Creates a new instance of . @@ -37,7 +37,7 @@ /// The parent /// the belongs to. /// Thrown when any parameter is null. - public MapDataContext(MapData wrappedData, MapDataCollection parentMapData) + protected MapDataContext(MapData wrappedData, MapDataCollection parentMapData) : base(wrappedData) { if (parentMapData == null) Index: Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLegendViewTest.cs =================================================================== diff -u -r3098804e6dc9d7aae2733700bfb5772eab1956d7 -r7b3ee0978809b7e423487a599c3ded787efeeefe --- Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLegendViewTest.cs (.../MapLegendViewTest.cs) (revision 3098804e6dc9d7aae2733700bfb5772eab1956d7) +++ Core/Plugins/test/Core.Plugins.Map.Test/Legend/MapLegendViewTest.cs (.../MapLegendViewTest.cs) (revision 7b3ee0978809b7e423487a599c3ded787efeeefe) @@ -29,6 +29,7 @@ using Core.Common.Util.Reflection; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; +using Core.Components.Gis.TestUtil; using Core.Plugins.Map.Legend; using Core.Plugins.Map.PresentationObjects; using Core.Plugins.Map.Properties; @@ -191,7 +192,7 @@ Data = mapDataCollection }) { - var context = new MapDataContext(mapData, mapDataCollection); + var context = new TestMapDataContext(mapData, mapDataCollection); var treeViewControl = TypeUtils.GetField(view, "treeViewControl"); WindowsFormsTestHelper.Show(treeViewControl); @@ -258,7 +259,7 @@ view.SelectionChanged += (sender, args) => selectionChangedCount++; // When - var context = new MapDataContext(mapData, mapDataCollection); + var context = new TestMapDataContext(mapData, mapDataCollection); treeViewControl.TrySelectNodeForData(context); // Then @@ -268,6 +269,12 @@ WindowsFormsTestHelper.CloseAll(); } + private class TestMapDataContext : MapDataContext + { + public TestMapDataContext(MapData wrappedData, MapDataCollection parentMapData) + : base(wrappedData, parentMapData) {} + } + [Test] [Apartment(ApartmentState.STA)] public void GivenMapLegendView_WhenSettingData_SelectionChangedFired() Index: Core/Plugins/test/Core.Plugins.Map.Test/PresentationObjects/MapDataContextTest.cs =================================================================== diff -u -r659a905aa024b3d1cd02b7f832da26524e5f0bc1 -r7b3ee0978809b7e423487a599c3ded787efeeefe --- Core/Plugins/test/Core.Plugins.Map.Test/PresentationObjects/MapDataContextTest.cs (.../MapDataContextTest.cs) (revision 659a905aa024b3d1cd02b7f832da26524e5f0bc1) +++ Core/Plugins/test/Core.Plugins.Map.Test/PresentationObjects/MapDataContextTest.cs (.../MapDataContextTest.cs) (revision 7b3ee0978809b7e423487a599c3ded787efeeefe) @@ -41,7 +41,7 @@ collection.Add(data); // Call - var context = new MapDataContext(data, collection); + var context = new TestMapDataContext(data, collection); // Assert Assert.IsInstanceOf>(context); @@ -53,11 +53,17 @@ public void Constructor_ParentMapDataNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new MapDataContext(new TestMapData(), null); + TestDelegate call = () => new TestMapDataContext(new TestMapData(), null); // Assert var exception = Assert.Throws(call); Assert.AreEqual("parentMapData", exception.ParamName); } + + private class TestMapDataContext : MapDataContext + { + public TestMapDataContext(MapData wrappedData, MapDataCollection parentMapData) + : base(wrappedData, parentMapData) {} + } } } \ No newline at end of file