Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r01740ebd72eef02813c719fc61a4d36563282331 -r78c515b5cf1df7b89dafcd0f5279e9c4e19edb34 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 01740ebd72eef02813c719fc61a4d36563282331) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 78c515b5cf1df7b89dafcd0f5279e9c4e19edb34) @@ -240,6 +240,10 @@ CreateInstance = context => new CalculationGroupContextProperties(context) }; yield return new PropertyInfo, CalculationContextProperties>(); + yield return new PropertyInfo + { + CreateInstance = context => new DesignWaterLevelCalculationsProperties(context.WrappedData) + }; yield return new PropertyInfo { CreateInstance = context => new DesignWaterLevelCalculationsProperties(context.WrappedData) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/WaterLevelCalculationsForNormTargetProbabilityContextPropertyInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/WaterLevelCalculationsForNormTargetProbabilityContextPropertyInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/WaterLevelCalculationsForNormTargetProbabilityContextPropertyInfoTest.cs (revision 78c515b5cf1df7b89dafcd0f5279e9c4e19edb34) @@ -0,0 +1,86 @@ +// Copyright (C) Stichting Deltares 2021. 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.Common.Base; +using Core.Gui.Plugin; +using Core.Gui.PropertyBag; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Common.Data.Hydraulics; +using Riskeer.Common.Forms.PresentationObjects; +using Riskeer.Common.Forms.PropertyClasses; + +namespace Riskeer.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class WaterLevelCalculationsForNormTargetProbabilityContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RiskeerPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.AreEqual(typeof(DesignWaterLevelCalculationsProperties), info.PropertyObjectType); + } + } + + [Test] + public void CreateInstance_WithContext_SetsDataCorrectly() + { + // Setup + var mockRepository = new MockRepository(); + var assessmentSection = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var hydraulicBoundaryLocationCalculations = new ObservableList(); + + var context = new WaterLevelCalculationsForNormTargetProbabilityContext(hydraulicBoundaryLocationCalculations, + assessmentSection, + () => 0.01); + + using (var plugin = new RiskeerPlugin()) + { + PropertyInfo info = GetInfo(plugin); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(hydraulicBoundaryLocationCalculations, objectProperties.Data); + } + + mockRepository.VerifyAll(); + } + + private static PropertyInfo GetInfo(RiskeerPlugin plugin) + { + return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaterLevelCalculationsForNormTargetProbabilityContext)); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs =================================================================== diff -u -r544056be18adf3fb401798998f445a79f608d09a -r78c515b5cf1df7b89dafcd0f5279e9c4e19edb34 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 544056be18adf3fb401798998f445a79f608d09a) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 78c515b5cf1df7b89dafcd0f5279e9c4e19edb34) @@ -232,7 +232,7 @@ PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray(); // Assert - Assert.AreEqual(26, propertyInfos.Length); + Assert.AreEqual(27, propertyInfos.Length); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, @@ -281,6 +281,11 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, + typeof(WaterLevelCalculationsForNormTargetProbabilityContext), + typeof(DesignWaterLevelCalculationsProperties)); + + PluginTestHelper.AssertPropertyInfoDefined( + propertyInfos, typeof(DesignWaterLevelCalculationsContext), typeof(DesignWaterLevelCalculationsProperties));