Index: Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs =================================================================== diff -u -rc92d335f9bedbece8f5690ea8d7c4d7be314afc2 -r1a9b38bd1ee2a340afb815647d78e3cdea953726 --- Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs (.../MapPlugin.cs) (revision c92d335f9bedbece8f5690ea8d7c4d7be314afc2) +++ Core/Plugins/src/Core.Plugins.Map/MapPlugin.cs (.../MapPlugin.cs) (revision 1a9b38bd1ee2a340afb815647d78e3cdea953726) @@ -79,9 +79,9 @@ { CreateInstance = data => new MapPointDataProperties((MapPointData) data.WrappedData) }; - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = data => new MapLineDataProperties(data) + CreateInstance = data => new MapLineDataProperties((MapLineData) data.WrappedData) }; yield return new PropertyInfo { Index: Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj =================================================================== diff -u -rc92d335f9bedbece8f5690ea8d7c4d7be314afc2 -r1a9b38bd1ee2a340afb815647d78e3cdea953726 --- Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision c92d335f9bedbece8f5690ea8d7c4d7be314afc2) +++ Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision 1a9b38bd1ee2a340afb815647d78e3cdea953726) @@ -70,6 +70,7 @@ + Component Index: Core/Plugins/test/Core.Plugins.Map.Test/PropertyInfos/MapLineDataContextPropertyInfoTest.cs =================================================================== diff -u --- Core/Plugins/test/Core.Plugins.Map.Test/PropertyInfos/MapLineDataContextPropertyInfoTest.cs (revision 0) +++ Core/Plugins/test/Core.Plugins.Map.Test/PropertyInfos/MapLineDataContextPropertyInfoTest.cs (revision 1a9b38bd1ee2a340afb815647d78e3cdea953726) @@ -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 MapLineDataContextPropertyInfoTest + { + private MapPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new MapPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(MapLineDataProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(MapLineDataContext), info.DataType); + Assert.AreEqual(typeof(MapLineDataProperties), info.PropertyObjectType); + } + + [Test] + public void CreateInstance_WithValidArguments_NewPropertiesWithMapDataCollectionAsData() + { + // Setup + var mapData = new MapLineData("Test"); + var context = new MapLineDataContext(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