Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj =================================================================== diff -u -r60e31a4d64f102398b83b082294299d0ce44a4a8 -r860e101b6aa9ae441d50ccb3b0da5d5e46f0b4dd --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj (.../Ringtoets.DuneErosion.Forms.csproj) (revision 60e31a4d64f102398b83b082294299d0ce44a4a8) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj (.../Ringtoets.DuneErosion.Forms.csproj) (revision 860e101b6aa9ae441d50ccb3b0da5d5e46f0b4dd) @@ -31,6 +31,7 @@ True Resources.resx + UserControl Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/AggregatedDuneLocation.cs =================================================================== diff -u --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/AggregatedDuneLocation.cs (revision 0) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/AggregatedDuneLocation.cs (revision 860e101b6aa9ae441d50ccb3b0da5d5e46f0b4dd) @@ -0,0 +1,229 @@ +// 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 Core.Common.Base.Data; +using Core.Common.Base.Geometry; + +namespace Ringtoets.DuneErosion.Forms.Views +{ + /// + /// Class that holds all the information of a dune location and calculations. + /// + public class AggregatedDuneLocation + { + /// + /// Creates a new instance of . + /// + /// The id of the dune location. + /// The name of the dune location. + /// The location of the dune location + /// The coastal area id of the dune location. + /// The offset of the dune location. + /// The d50 of the dune location. + /// The result of the water level calculation + /// for the mechanism specific factorized signaling norm. + /// The result of the water level calculation + /// for the mechanism specific signaling norm. + /// The result of the water level calculation + /// for the mechanism specific lower limit norm. + /// The result of the water level calculation + /// for the lower limit norm. + /// The result of the water level calculation + /// for the factorized lower limit norm. + /// The result of the wave height calculation + /// for the mechanism specific factorized signaling norm. + /// The result of the wave height calculation + /// for the mechanism specific signaling norm. + /// The result of the wave height calculation + /// for the mechanism specific lower limit norm. + /// The result of the wave height calculation + /// for the lower limit norm. + /// The result of the wave height calculation + /// for the factorized lower limit norm. + /// The result of the wave period calculation + /// for the mechanism specific factorized signaling norm. + /// The result of the wave period calculation + /// for the mechanism specific signaling norm. + /// The result of the wave period calculation + /// for the mechanism specific lower limit norm. + /// The result of the wave period calculation + /// for the lower limit norm. + /// The result of the wave period calculation + /// for the factorized lower limit norm. + /// Thrown when or + /// is null. + public AggregatedDuneLocation(long id, string name, Point2D location, int coastalAreaId, RoundedDouble offset, RoundedDouble d50, + RoundedDouble waterLevelForMechanismSpecificFactorizedSignalingNorm, + RoundedDouble waterLevelForMechanismSpecificSignalingNorm, + RoundedDouble waterLevelForMechanismSpecificLowerLimitNorm, + RoundedDouble waterLevelForLowerLimitNorm, + RoundedDouble waterLevelForFactorizedLowerLimitNorm, + RoundedDouble waveHeightForMechanismSpecificFactorizedSignalingNorm, + RoundedDouble waveHeightForMechanismSpecificSignalingNorm, + RoundedDouble waveHeightForMechanismSpecificLowerLimitNorm, + RoundedDouble waveHeightForLowerLimitNorm, + RoundedDouble waveHeightForFactorizedLowerLimitNorm, + RoundedDouble wavePeriodForMechanismSpecificFactorizedSignalingNorm, + RoundedDouble wavePeriodForMechanismSpecificSignalingNorm, + RoundedDouble wavePeriodForMechanismSpecificLowerLimitNorm, + RoundedDouble wavePeriodForLowerLimitNorm, + RoundedDouble wavePeriodForFactorizedLowerLimitNorm) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + Id = id; + Name = name; + Location = location; + CoastalAreaId = coastalAreaId; + Offset = offset; + D50 = d50; + WaterLevelForMechanismSpecificFactorizedSignalingNorm = waterLevelForMechanismSpecificFactorizedSignalingNorm; + WaterLevelForMechanismSpecificSignalingNorm = waterLevelForMechanismSpecificSignalingNorm; + WaterLevelForMechanismSpecificLowerLimitNorm = waterLevelForMechanismSpecificLowerLimitNorm; + WaterLevelForLowerLimitNorm = waterLevelForLowerLimitNorm; + WaterLevelForFactorizedLowerLimitNorm = waterLevelForFactorizedLowerLimitNorm; + WaveHeightForMechanismSpecificFactorizedSignalingNorm = waveHeightForMechanismSpecificFactorizedSignalingNorm; + WaveHeightForMechanismSpecificSignalingNorm = waveHeightForMechanismSpecificSignalingNorm; + WaveHeightForMechanismSpecificLowerLimitNorm = waveHeightForMechanismSpecificLowerLimitNorm; + WaveHeightForLowerLimitNorm = waveHeightForLowerLimitNorm; + WaveHeightForFactorizedLowerLimitNorm = waveHeightForFactorizedLowerLimitNorm; + WavePeriodForMechanismSpecificFactorizedSignalingNorm = wavePeriodForMechanismSpecificFactorizedSignalingNorm; + WavePeriodForMechanismSpecificSignalingNorm = wavePeriodForMechanismSpecificSignalingNorm; + WavePeriodForMechanismSpecificLowerLimitNorm = wavePeriodForMechanismSpecificLowerLimitNorm; + WavePeriodForLowerLimitNorm = wavePeriodForLowerLimitNorm; + WavePeriodForFactorizedLowerLimitNorm = wavePeriodForFactorizedLowerLimitNorm; + } + + /// + /// Gets the id of the dune location. + /// + public long Id { get; } + + /// + /// Gets the name of the dune location. + /// + public string Name { get; } + + /// + /// Gets the location of the dune location. + /// + public Point2D Location { get; } + + /// + /// Gets the coastal area id of the dune location. + /// + public int CoastalAreaId { get; } + + /// + /// Gets the offset of the dune location. + /// + public RoundedDouble Offset { get; } + + /// + /// Gets the d50 of the dune location. + /// + public RoundedDouble D50 { get; } + + /// + /// Gets the result of the water level for the mechanism specific factorized signaling norm. + /// + public RoundedDouble WaterLevelForMechanismSpecificFactorizedSignalingNorm { get; } + + /// + /// Gets the result of the water level for the mechanism specific signaling norm. + /// + public RoundedDouble WaterLevelForMechanismSpecificSignalingNorm { get; } + + /// + /// Gets the result of the water level for the mechanism specific lower limit norm. + /// + public RoundedDouble WaterLevelForMechanismSpecificLowerLimitNorm { get; } + + /// + /// Gets the result of the water level for the lower limit norm. + /// + public RoundedDouble WaterLevelForLowerLimitNorm { get; } + + /// + /// Gets the result of the water level for the factorized lower limit norm. + /// + public RoundedDouble WaterLevelForFactorizedLowerLimitNorm { get; } + + /// + /// Gets the result of the wave height for the mechanism specific factorized signaling norm. + /// + public RoundedDouble WaveHeightForMechanismSpecificFactorizedSignalingNorm { get; } + + /// + /// Gets the result of the wave height for the mechanism specific signaling norm. + /// + public RoundedDouble WaveHeightForMechanismSpecificSignalingNorm { get; } + + /// + /// Gets the result of the wave height for the mechanism specific lower limit norm. + /// + public RoundedDouble WaveHeightForMechanismSpecificLowerLimitNorm { get; } + + /// + /// Gets the result of the wave height for the lower limit norm. + /// + public RoundedDouble WaveHeightForLowerLimitNorm { get; } + + /// + /// Gets the result of the wave height for the factorized lower limit norm. + /// + public RoundedDouble WaveHeightForFactorizedLowerLimitNorm { get; } + + /// + /// Gets the result of the wave period for the mechanism specific factorized signaling norm. + /// + public RoundedDouble WavePeriodForMechanismSpecificFactorizedSignalingNorm { get; } + + /// + /// Gets the result of the wave period for the mechanism specific signaling norm. + /// + public RoundedDouble WavePeriodForMechanismSpecificSignalingNorm { get; } + + /// + /// Gets the result of the wave period for the mechanism specific lower limit norm. + /// + public RoundedDouble WavePeriodForMechanismSpecificLowerLimitNorm { get; } + + /// + /// Gets the result of the wave period for the lower limit norm. + /// + public RoundedDouble WavePeriodForLowerLimitNorm { get; } + + /// + /// Gets the result of the wave period for the factorized lower limit norm. + /// + public RoundedDouble WavePeriodForFactorizedLowerLimitNorm { get; } + } +} \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj =================================================================== diff -u -r60e31a4d64f102398b83b082294299d0ce44a4a8 -r860e101b6aa9ae441d50ccb3b0da5d5e46f0b4dd --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj (.../Ringtoets.DuneErosion.Forms.Test.csproj) (revision 60e31a4d64f102398b83b082294299d0ce44a4a8) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj (.../Ringtoets.DuneErosion.Forms.Test.csproj) (revision 860e101b6aa9ae441d50ccb3b0da5d5e46f0b4dd) @@ -33,6 +33,7 @@ + Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/AggregatedDuneLocationTest.cs =================================================================== diff -u --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/AggregatedDuneLocationTest.cs (revision 0) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/AggregatedDuneLocationTest.cs (revision 860e101b6aa9ae441d50ccb3b0da5d5e46f0b4dd) @@ -0,0 +1,133 @@ +// 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 Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.DuneErosion.Forms.Views; + +namespace Ringtoets.DuneErosion.Forms.Test.Views +{ + [TestFixture] + public class AggregatedDuneLocationTest + { + [Test] + public void Constructor_NameNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new AggregatedDuneLocation(0, null, new Point2D(0, 0), 0, new RoundedDouble(), new RoundedDouble(), + new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), + new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), + new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("name", exception.ParamName); + } + + [Test] + public void Constructor_LocationNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new AggregatedDuneLocation(0, string.Empty, null, 0, new RoundedDouble(), new RoundedDouble(), + new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), + new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), + new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble(), new RoundedDouble()); + ; + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("location", exception.ParamName); + } + + [Test] + public void Constructor_WithArguments_ExpectedValues() + { + // Setup + var random = new Random(21); + + long id = random.Next(); + const string name = "DuneLocationName"; + var location = new Point2D(random.NextDouble(), random.NextDouble()); + int coastalAreaId = random.Next(); + RoundedDouble offset = random.NextRoundedDouble(); + RoundedDouble d50 = random.NextRoundedDouble(); + RoundedDouble waterLevelForMechanismSpecificFactorizedSignalingNorm = random.NextRoundedDouble(); + RoundedDouble waterLevelForMechanismSpecificSignalingNorm = random.NextRoundedDouble(); + RoundedDouble waterLevelForMechanismSpecificLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble waterLevelForLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble waterLevelForFactorizedLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble waveHeightForMechanismSpecificFactorizedSignalingNorm = random.NextRoundedDouble(); + RoundedDouble waveHeightForMechanismSpecificSignalingNorm = random.NextRoundedDouble(); + RoundedDouble waveHeightForMechanismSpecificLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble waveHeightForLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble waveHeightForFactorizedLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble wavePeriodForMechanismSpecificFactorizedSignalingNorm = random.NextRoundedDouble(); + RoundedDouble wavePeriodForMechanismSpecificSignalingNorm = random.NextRoundedDouble(); + RoundedDouble wavePeriodForMechanismSpecificLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble wavePeriodForLowerLimitNorm = random.NextRoundedDouble(); + RoundedDouble wavePeriodForFactorizedLowerLimitNorm = random.NextRoundedDouble(); + + // Call + var aggregatedDuneLocation = new AggregatedDuneLocation(id, name, location, coastalAreaId, offset, d50, + waterLevelForMechanismSpecificFactorizedSignalingNorm, + waterLevelForMechanismSpecificSignalingNorm, + waterLevelForMechanismSpecificLowerLimitNorm, + waterLevelForLowerLimitNorm, + waterLevelForFactorizedLowerLimitNorm, + waveHeightForMechanismSpecificFactorizedSignalingNorm, + waveHeightForMechanismSpecificSignalingNorm, + waveHeightForMechanismSpecificLowerLimitNorm, + waveHeightForLowerLimitNorm, + waveHeightForFactorizedLowerLimitNorm, + wavePeriodForMechanismSpecificFactorizedSignalingNorm, + wavePeriodForMechanismSpecificSignalingNorm, + wavePeriodForMechanismSpecificLowerLimitNorm, + wavePeriodForLowerLimitNorm, + wavePeriodForFactorizedLowerLimitNorm); + + // Assert + Assert.AreEqual(id, aggregatedDuneLocation.Id); + Assert.AreEqual(name, aggregatedDuneLocation.Name); + Assert.AreSame(location, aggregatedDuneLocation.Location); + Assert.AreEqual(coastalAreaId, aggregatedDuneLocation.CoastalAreaId); + Assert.AreEqual(offset, aggregatedDuneLocation.Offset); + Assert.AreEqual(d50, aggregatedDuneLocation.D50); + Assert.AreEqual(waterLevelForMechanismSpecificFactorizedSignalingNorm, aggregatedDuneLocation.WaterLevelForMechanismSpecificFactorizedSignalingNorm); + Assert.AreEqual(waterLevelForMechanismSpecificSignalingNorm, aggregatedDuneLocation.WaterLevelForMechanismSpecificSignalingNorm); + Assert.AreEqual(waterLevelForMechanismSpecificLowerLimitNorm, aggregatedDuneLocation.WaterLevelForMechanismSpecificLowerLimitNorm); + Assert.AreEqual(waterLevelForLowerLimitNorm, aggregatedDuneLocation.WaterLevelForLowerLimitNorm); + Assert.AreEqual(waterLevelForFactorizedLowerLimitNorm, aggregatedDuneLocation.WaterLevelForFactorizedLowerLimitNorm); + Assert.AreEqual(waveHeightForMechanismSpecificFactorizedSignalingNorm, aggregatedDuneLocation.WaveHeightForMechanismSpecificFactorizedSignalingNorm); + Assert.AreEqual(waveHeightForMechanismSpecificSignalingNorm, aggregatedDuneLocation.WaveHeightForMechanismSpecificSignalingNorm); + Assert.AreEqual(waveHeightForMechanismSpecificLowerLimitNorm, aggregatedDuneLocation.WaveHeightForMechanismSpecificLowerLimitNorm); + Assert.AreEqual(waveHeightForLowerLimitNorm, aggregatedDuneLocation.WaveHeightForLowerLimitNorm); + Assert.AreEqual(waveHeightForFactorizedLowerLimitNorm, aggregatedDuneLocation.WaveHeightForFactorizedLowerLimitNorm); + Assert.AreEqual(wavePeriodForMechanismSpecificFactorizedSignalingNorm, aggregatedDuneLocation.WavePeriodForMechanismSpecificFactorizedSignalingNorm); + Assert.AreEqual(wavePeriodForMechanismSpecificSignalingNorm, aggregatedDuneLocation.WavePeriodForMechanismSpecificSignalingNorm); + Assert.AreEqual(wavePeriodForMechanismSpecificLowerLimitNorm, aggregatedDuneLocation.WavePeriodForMechanismSpecificLowerLimitNorm); + Assert.AreEqual(wavePeriodForLowerLimitNorm, aggregatedDuneLocation.WavePeriodForLowerLimitNorm); + Assert.AreEqual(wavePeriodForFactorizedLowerLimitNorm, aggregatedDuneLocation.WavePeriodForFactorizedLowerLimitNorm); + } + } +} \ No newline at end of file