Index: Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs =================================================================== diff -u -r2a807b3bb6032040d414c81466983f989ad0b55d -rc92d335f9bedbece8f5690ea8d7c4d7be314afc2 --- Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs (.../MapPlugin.cs) (revision 2a807b3bb6032040d414c81466983f989ad0b55d) +++ Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs (.../MapPlugin.cs) (revision c92d335f9bedbece8f5690ea8d7c4d7be314afc2) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2018. All rights reserved. +// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of Ringtoets. // @@ -75,9 +75,9 @@ { CreateInstance = context => new MapDataCollectionProperties((MapDataCollection) context.WrappedData, MapDataContextHelper.GetParentsFromContext(context)) }; - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = data => new MapPointDataProperties(data) + CreateInstance = data => new MapPointDataProperties((MapPointData) data.WrappedData) }; yield return new PropertyInfo { Index: Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj =================================================================== diff -u -ra60c62d19bd689b7fd98dd6735393af54f5d2586 -rc92d335f9bedbece8f5690ea8d7c4d7be314afc2 --- Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision a60c62d19bd689b7fd98dd6735393af54f5d2586) +++ Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision c92d335f9bedbece8f5690ea8d7c4d7be314afc2) @@ -70,6 +70,7 @@ + Component Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyInfos/MapPointDataContextPropertyInfoTest.cs =================================================================== diff -u --- Core/Plugins/test/Core.Plugins.Map.Test/PropertyInfos/MapPointDataContextPropertyInfoTest.cs (revision 0) +++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyInfos/MapPointDataContextPropertyInfoTest.cs (revision c92d335f9bedbece8f5690ea8d7c4d7be314afc2) @@ -0,0 +1,74 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Linq; +using Core.Common.Gui.Plugin; +using Core.Common.Gui.PropertyBag; +using Core.Components.Gis.Data; +using Core.Plugins.Map.PresentationObjects; +using Core.Plugins.Map.PropertyClasses; +using NUnit.Framework; + +namespace Core.Plugins.Map.Test.PropertyInfos +{ + [TestFixture] + public class MapPointDataContextPropertyInfoTest + { + private MapPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new MapPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(MapPointDataProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(MapPointDataContext), info.DataType); + Assert.AreEqual(typeof(MapPointDataProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_WithValidArguments_NewPropertiesWithMapDataCollectionAsData() + { + // Setup + var mapData = new MapPointData("Test"); + var context = new MapPointDataContext(mapData, new MapDataCollectionContext(new MapDataCollection("test"), null)); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(mapData, objectProperties.Data); + } + } +} \ No newline at end of file