Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelCalculationContext.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelCalculationContext.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelCalculationContext.cs (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2017. 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 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; +using Ringtoets.Common.Data.Hydraulics; + +namespace Ringtoets.Integration.Forms.PresentationObjects +{ + /// + /// Presentation object for all data required to configure an instance of + /// with a design water level calculation result. + /// + public class DesignWaterLevelCalculationContext : HydraulicBoundaryLocationCalculationContext + { + /// + /// Creates a new instance of . + /// + /// The which the + /// belongs to. + /// Thrown when is null. + public DesignWaterLevelCalculationContext(HydraulicBoundaryLocationCalculation wrappedData) + : base(wrappedData) {} + } +} \ No newline at end of file Fisheye: Tag 144184f501703e05c66062fa44040fa89d99f694 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r55311d5ec9f5dbe89c93bdcd7ae51b7931dbef94 -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 55311d5ec9f5dbe89c93bdcd7ae51b7931dbef94) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -27,7 +27,7 @@ - + Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs =================================================================== diff -u -r1f7f79eaf55689da4a8921bb7f15960a2fff9ab7 -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision 1f7f79eaf55689da4a8921bb7f15960a2fff9ab7) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -80,7 +80,7 @@ { HydraulicBoundaryLocation hydraulicBoundaryLocation = ((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject; - return new DesignWaterLevelLocationContext(GetCalculationFunc(hydraulicBoundaryLocation)); + return new DesignWaterLevelCalculationContext(GetCalculationFunc(hydraulicBoundaryLocation)); } return null; Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r4dfedddc797825c49f4ca459dc38be7bc9978ccb -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 4dfedddc797825c49f4ca459dc38be7bc9978ccb) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -337,7 +337,7 @@ return new DesignWaterLevelCalculationsProperties(hydraulicBoundaryLocationCalculations); } }; - yield return new PropertyInfo + yield return new PropertyInfo { CreateInstance = context => new DesignWaterLevelCalculationProperties(context.WrappedData) }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelCalculationContextTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelCalculationContextTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelCalculationContextTest.cs (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2017. 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 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 NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Forms.PresentationObjects; + +namespace Ringtoets.Integration.Forms.Test.PresentationObjects +{ + [TestFixture] + public class DesignWaterLevelCalculationContextTest + { + [Test] + public void Constructor_ValidParameters_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + + // Call + var context = new DesignWaterLevelCalculationContext(hydraulicBoundaryLocationCalculation); + + // Assert + Assert.IsInstanceOf(context); + Assert.AreSame(hydraulicBoundaryLocationCalculation, context.WrappedData); + } + } +} \ No newline at end of file Fisheye: Tag 144184f501703e05c66062fa44040fa89d99f694 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r55311d5ec9f5dbe89c93bdcd7ae51b7931dbef94 -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 55311d5ec9f5dbe89c93bdcd7ae51b7931dbef94) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -37,7 +37,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r1f7f79eaf55689da4a8921bb7f15960a2fff9ab7 -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 1f7f79eaf55689da4a8921bb7f15960a2fff9ab7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -677,7 +677,7 @@ { HydraulicBoundaryLocation hydraulicBoundaryLocation = ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject; - return new DesignWaterLevelLocationContext(GetCalculationForLocation(hydraulicBoundaryLocation)); + return new DesignWaterLevelCalculationContext(GetCalculationForLocation(hydraulicBoundaryLocation)); } protected override LocationsView ShowFullyConfiguredLocationsView(Form form) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelCalculationContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelCalculationContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelCalculationContextPropertyInfoTest.cs (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2017. 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 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; +using System.Linq; +using Core.Common.Base.Data; +using Core.Common.Gui.Plugin; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Forms.PresentationObjects; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class DesignWaterLevelCalculationContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.AreEqual(typeof(DesignWaterLevelCalculationContext), info.DataType); + Assert.AreEqual(typeof(DesignWaterLevelCalculationProperties), info.PropertyObjectType); + } + } + + [Test] + public void CreateInstance_WithContext_SetsDataCorrectly() + { + // Setup + double designWaterLevel = new Random().NextDouble(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + { + Output = new TestHydraulicBoundaryLocationOutput(designWaterLevel) + }; + + var context = new DesignWaterLevelCalculationContext(hydraulicBoundaryLocationCalculation); + + using (var plugin = new RingtoetsPlugin()) + { + PropertyInfo info = GetInfo(plugin); + + // Call + IObjectProperties objectProperties = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(hydraulicBoundaryLocationCalculation, objectProperties.Data); + RoundedDouble actualDesignWaterLevel = ((DesignWaterLevelCalculationProperties) objectProperties).DesignWaterLevel; + Assert.AreEqual(designWaterLevel, actualDesignWaterLevel, actualDesignWaterLevel.GetAccuracy()); + } + } + + private static PropertyInfo GetInfo(RingtoetsPlugin plugin) + { + return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(DesignWaterLevelCalculationContext)); + } + } +} \ No newline at end of file Fisheye: Tag 144184f501703e05c66062fa44040fa89d99f694 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationContextPropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -r8b8e62bfddfca997d2ed5df4a0c9c72648f1b5b4 -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 8b8e62bfddfca997d2ed5df4a0c9c72648f1b5b4) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -50,7 +50,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -ra64d9feaca1f48e4549264af463c89ca6979f5d9 -r144184f501703e05c66062fa44040fa89d99f694 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision a64d9feaca1f48e4549264af463c89ca6979f5d9) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 144184f501703e05c66062fa44040fa89d99f694) @@ -282,7 +282,7 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(DesignWaterLevelLocationContext), + typeof(DesignWaterLevelCalculationContext), typeof(DesignWaterLevelCalculationProperties)); PluginTestHelper.AssertPropertyInfoDefined(