Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightCalculationContext.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightCalculationContext.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightCalculationContext.cs (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -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 wave height calculation result. + /// + public class WaveHeightCalculationContext : HydraulicBoundaryLocationCalculationContext + { + /// + /// Creates a new instance of . + /// + /// The which the + /// belongs to. + /// Thrown when is null. + public WaveHeightCalculationContext(HydraulicBoundaryLocationCalculation wrappedData) + : base(wrappedData) {} + } +} \ No newline at end of file Fisheye: Tag 277474bff827855e198867eb1a794ec7f44d54b2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r144184f501703e05c66062fa44040fa89d99f694 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 144184f501703e05c66062fa44040fa89d99f694) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -34,7 +34,7 @@ - + Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs =================================================================== diff -u -r1f7f79eaf55689da4a8921bb7f15960a2fff9ab7 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs (.../WaveHeightLocationsView.cs) (revision 1f7f79eaf55689da4a8921bb7f15960a2fff9ab7) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs (.../WaveHeightLocationsView.cs) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -80,7 +80,7 @@ { HydraulicBoundaryLocation hydraulicBoundaryLocation = ((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject; - return new WaveHeightLocationContext(GetCalculationFunc(hydraulicBoundaryLocation)); + return new WaveHeightCalculationContext(GetCalculationFunc(hydraulicBoundaryLocation)); } return null; Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r144184f501703e05c66062fa44040fa89d99f694 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 144184f501703e05c66062fa44040fa89d99f694) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -352,7 +352,7 @@ return new WaveHeightCalculationsProperties(hydraulicBoundaryLocationCalculations); } }; - yield return new PropertyInfo + yield return new PropertyInfo { CreateInstance = context => new WaveHeightCalculationProperties(context.WrappedData) }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightCalculationContextTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightCalculationContextTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightCalculationContextTest.cs (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -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 WaveHeightCalculationContextTest + { + [Test] + public void Constructor_ValidParameters_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + + // Call + var context = new WaveHeightCalculationContext(hydraulicBoundaryLocationCalculation); + + // Assert + Assert.IsInstanceOf(context); + Assert.AreSame(hydraulicBoundaryLocationCalculation, context.WrappedData); + } + } +} \ No newline at end of file Fisheye: Tag 277474bff827855e198867eb1a794ec7f44d54b2 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r144184f501703e05c66062fa44040fa89d99f694 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 144184f501703e05c66062fa44040fa89d99f694) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -51,7 +51,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r1f7f79eaf55689da4a8921bb7f15960a2fff9ab7 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 1f7f79eaf55689da4a8921bb7f15960a2fff9ab7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -677,7 +677,7 @@ { HydraulicBoundaryLocation hydraulicBoundaryLocation = ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject; - return new WaveHeightLocationContext(GetCalculationForLocation(hydraulicBoundaryLocation)); + return new WaveHeightCalculationContext(GetCalculationForLocation(hydraulicBoundaryLocation)); } protected override LocationsView ShowFullyConfiguredLocationsView(Form form) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightCalculationContextPropertyInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightCalculationContextPropertyInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightCalculationContextPropertyInfoTest.cs (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -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 WaveHeightCalculationContextPropertyInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + // Call + PropertyInfo info = GetInfo(plugin); + + // Assert + Assert.AreEqual(typeof(WaveHeightCalculationContext), info.DataType); + Assert.AreEqual(typeof(WaveHeightCalculationProperties), info.PropertyObjectType); + } + } + + [Test] + public void CreateInstance_WithContext_SetsDataCorrectly() + { + // Setup + double waveHeight = new Random().NextDouble(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + { + Output = new TestHydraulicBoundaryLocationOutput(waveHeight) + }; + + var context = new WaveHeightCalculationContext(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 actualWaveHeight = ((WaveHeightCalculationProperties) objectProperties).WaveHeight; + Assert.AreEqual(waveHeight, actualWaveHeight, actualWaveHeight.GetAccuracy()); + } + } + + private static PropertyInfo GetInfo(RingtoetsPlugin plugin) + { + return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveHeightCalculationContext)); + } + } +} \ No newline at end of file Fisheye: Tag 277474bff827855e198867eb1a794ec7f44d54b2 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationContextPropertyInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -r144184f501703e05c66062fa44040fa89d99f694 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 144184f501703e05c66062fa44040fa89d99f694) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -49,7 +49,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r144184f501703e05c66062fa44040fa89d99f694 -r277474bff827855e198867eb1a794ec7f44d54b2 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 144184f501703e05c66062fa44040fa89d99f694) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 277474bff827855e198867eb1a794ec7f44d54b2) @@ -292,7 +292,7 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(WaveHeightLocationContext), + typeof(WaveHeightCalculationContext), typeof(WaveHeightCalculationProperties)); PluginTestHelper.AssertPropertyInfoDefined(