Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r860eed203cc3c5066a637a614445b4c842cdd93d -rb8ab33c43fb24b79930ae9de614107644ced42b4 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 860eed203cc3c5066a637a614445b4c842cdd93d) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision b8ab33c43fb24b79930ae9de614107644ced42b4) @@ -238,7 +238,7 @@ { CreateInstance = data => new BackgroundDataProperties(data) }; - yield return new PropertyInfo + yield return new PropertyInfo { CreateInstance = context => new HydraulicBoundaryDataProperties(context.WrappedData) }; Fisheye: Tag b8ab33c43fb24b79930ae9de614107644ced42b4 refers to a dead (removed) revision in file `Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicBoundaryDataPropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicLocationConfigurationDatabasePropertyInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicLocationConfigurationDatabasePropertyInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/HydraulicLocationConfigurationDatabasePropertyInfoTest.cs (revision b8ab33c43fb24b79930ae9de614107644ced42b4) @@ -0,0 +1,86 @@ +// Copyright (C) Stichting Deltares 2022. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU 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 General Public License for more details. +// +// You should have received a copy of the GNU 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.Gui; +using Core.Gui.Forms.Main; +using Core.Gui.Plugin; +using Core.Gui.PropertyBag; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Common.Plugin.TestUtil; +using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.PresentationObjects; +using Riskeer.Integration.Forms.PropertyClasses; + +namespace Riskeer.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class HydraulicLocationConfigurationDatabasePropertyInfoTest + { + private RiskeerPlugin plugin; + private PropertyInfo info; + + [SetUp] + public void SetUp() + { + plugin = new RiskeerPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(HydraulicBoundaryDataProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(HydraulicLocationConfigurationDatabaseContext), info.DataType); + } + + [Test] + public void CreateInstance_WithContext_ReturnHydraulicBoundaryDataProperties() + { + // Setup + var mocks = new MockRepository(); + var mainWindow = mocks.Stub(); + IGui gui = StubFactory.CreateGuiStub(mocks); + gui.Stub(g => g.MainWindow).Return(mainWindow); + mocks.ReplayAll(); + + plugin.Gui = gui; + + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + var context = new HydraulicLocationConfigurationDatabaseContext(assessmentSection.HydraulicBoundaryData, assessmentSection); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(context.WrappedData, objectProperties.Data); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs =================================================================== diff -u -r574a93d0dabb86321072116542f16df60579234f -rb8ab33c43fb24b79930ae9de614107644ced42b4 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 574a93d0dabb86321072116542f16df60579234f) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision b8ab33c43fb24b79930ae9de614107644ced42b4) @@ -238,7 +238,7 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(HydraulicBoundaryDataContext), + typeof(HydraulicLocationConfigurationDatabaseContext), typeof(HydraulicBoundaryDataProperties)); PluginTestHelper.AssertPropertyInfoDefined(