Fisheye: Tag 899b5a68c26657a3943f409b5a16d00c0844859a refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Hydraulics/OvertoppingCalculationInput.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/HydraRingRoughnessProfilePoint.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/HydraRingRoughnessProfilePoint.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/HydraRingRoughnessProfilePoint.cs (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -0,0 +1,50 @@ +// Copyright (C) Stichting Deltares 2016. 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. + +namespace Ringtoets.HydraRing.Calculation.Data.Input.Overtopping +{ + /// + /// Container for Hydra-Ring profile point related data with roughness. + /// + public class HydraRingRoughnessProfilePoint : HydraRingProfilePoint + { + private readonly double roughness; + + /// + /// Creates a new instance of the class. + /// + /// The x coordinate. + /// The z coordinate. + /// The reduction factor. + public HydraRingRoughnessProfilePoint(double x, double z, double roughness) : base(x, z) + { + this.roughness = roughness; + } + + public override double Roughness + { + get + { + return roughness; + } + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/OvertoppingCalculationInput.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/OvertoppingCalculationInput.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/OvertoppingCalculationInput.cs (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -0,0 +1,105 @@ +// Copyright (C) Stichting Deltares 2016. 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.Collections.Generic; + +namespace Ringtoets.HydraRing.Calculation.Data.Input.Overtopping +{ + /// + /// Container of all data necessary for performing an overtopping calculation via Hydra-Ring. + /// + public class OvertoppingCalculationInput : ExceedanceProbabilityCalculationInput + { + private readonly HydraRingDikeSection dikeSection; + private readonly IEnumerable profilePoints; + private readonly IEnumerable forelandPoints; + + /// + /// Creates a new instance of the class. + /// + /// The id of the hydraulic station to use during the calculation. + /// The dike sections to use during the calculation. + /// The profile points to use during the calculation. + /// The foreland points to use during the calculation. + public OvertoppingCalculationInput(int hydraulicBoundaryLocationId, HydraRingDikeSection hydraRingDikeSection, + IEnumerable hydraRingProfilePoints, + IEnumerable hydraRingForelandPoints) + : base(hydraulicBoundaryLocationId) + { + dikeSection = hydraRingDikeSection; + profilePoints = hydraRingProfilePoints; + forelandPoints = hydraRingForelandPoints; + } + + public override HydraRingFailureMechanismType FailureMechanismType + { + get + { + return HydraRingFailureMechanismType.DikesOvertopping; + } + } + + public override int VariableId + { + get + { + return 1; + } + } + + public override HydraRingDikeSection DikeSection + { + get + { + return dikeSection; + } + } + + public override IEnumerable ProfilePoints + { + get + { + return profilePoints; + } + } + + public override IEnumerable ForelandsPoints + { + get + { + return forelandPoints; + } + } + + public override int? GetSubMechanismModelId(int subMechanismId) + { + switch (subMechanismId) + { + case 102: + return 94; + case 103: + return 95; + default: + return null; + } + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj =================================================================== diff -u -r27ab4d00d005742ce49aa4396e8c822fe040dacc -r899b5a68c26657a3943f409b5a16d00c0844859a --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 27ab4d00d005742ce49aa4396e8c822fe040dacc) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -46,8 +46,9 @@ + - + Fisheye: Tag 899b5a68c26657a3943f409b5a16d00c0844859a refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/OvertoppingCalculationInputTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Overtopping/HydraRingRoughnessProfilePointTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Overtopping/HydraRingRoughnessProfilePointTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Overtopping/HydraRingRoughnessProfilePointTest.cs (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2016. 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.HydraRing.Calculation.Data.Input.Overtopping; + +namespace Ringtoets.HydraRing.Calculation.Test.Data.Input.Overtopping +{ + [TestFixture] + public class HydraRingRoughnessProfilePointTest + { + [Test] + public void Constructor_Always_ExpectedValues() + { + // Setup + double expectedX = 1.1; + double expectedZ = 2.2; + double expectedRoughness = 3.3; + + // Call + HydraRingRoughnessProfilePoint hydraRingRoughnessProfilePoint = new HydraRingRoughnessProfilePoint(expectedX, expectedZ, expectedRoughness); + + // Assert + Assert.IsNotNull(hydraRingRoughnessProfilePoint); + Assert.AreEqual(expectedX, hydraRingRoughnessProfilePoint.X); + Assert.AreEqual(expectedZ, hydraRingRoughnessProfilePoint.Z); + Assert.AreEqual(expectedRoughness, hydraRingRoughnessProfilePoint.Roughness); + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Overtopping/OvertoppingCalculationInputTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Overtopping/OvertoppingCalculationInputTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Overtopping/OvertoppingCalculationInputTest.cs (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2016. 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.Collections.Generic; +using NUnit.Framework; +using Ringtoets.HydraRing.Calculation.Data; +using Ringtoets.HydraRing.Calculation.Data.Input.Overtopping; + +namespace Ringtoets.HydraRing.Calculation.Test.Data.Input.Overtopping +{ + [TestFixture] + public class OvertoppingCalculationInputTest + { + [Test] + public void Constructor_Always_ExpectedValues() + { + // Setup + const int expectedCalculationTypeId = 1; + const int expectedVariableId = 1; + int hydraulicBoundaryLocationId = 1000; + HydraRingDikeSection expectedDikeSection = new HydraRingDikeSection(expectedVariableId, "1000", double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); + var expectedRingProfilePoints = new List + { + new HydraRingProfilePoint(1.1, 2.2) + }; + var expectedRingForelandPoints = new List + { + new HydraRingForelandPoint(2.2, 3.3) + }; + + // Call + OvertoppingCalculationInput overtoppingCalculationInput = new OvertoppingCalculationInput(hydraulicBoundaryLocationId, expectedDikeSection, expectedRingProfilePoints, expectedRingForelandPoints); + + // Assert + Assert.AreEqual(expectedCalculationTypeId, overtoppingCalculationInput.CalculationTypeId); + Assert.AreEqual(hydraulicBoundaryLocationId, overtoppingCalculationInput.HydraulicBoundaryLocationId); + Assert.AreEqual(HydraRingFailureMechanismType.DikesOvertopping, overtoppingCalculationInput.FailureMechanismType); + Assert.AreEqual(expectedVariableId, overtoppingCalculationInput.VariableId); + Assert.IsNotNull(overtoppingCalculationInput.DikeSection); + CollectionAssert.IsEmpty(overtoppingCalculationInput.Variables); + CollectionAssert.AreEqual(expectedRingProfilePoints, overtoppingCalculationInput.ProfilePoints); + CollectionAssert.AreEqual(expectedRingForelandPoints, overtoppingCalculationInput.ForelandsPoints); + CollectionAssert.IsEmpty(overtoppingCalculationInput.BreakWaters); + Assert.IsNaN(overtoppingCalculationInput.Beta); + + var dikeSection = overtoppingCalculationInput.DikeSection; + Assert.AreEqual(expectedDikeSection, dikeSection); + } + + [Test] + [TestCase(101, null)] + [TestCase(102, 94)] + [TestCase(103, 95)] + [TestCase(104, null)] + public void GetSubMechanismModelId_Always_ReturnsExpectedValues(int subMechanismModelId, int? expectedSubMechanismModelId) + { + // Setup + HydraRingDikeSection expectedDikeSection = new HydraRingDikeSection(1, "1000", double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN); + + // Call + OvertoppingCalculationInput overtoppingCalculationInput = new OvertoppingCalculationInput(1, expectedDikeSection, new List(), new List()); + + // Assert + Assert.AreEqual(expectedSubMechanismModelId, overtoppingCalculationInput.GetSubMechanismModelId(subMechanismModelId)); + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs =================================================================== diff -u -r27ab4d00d005742ce49aa4396e8c822fe040dacc -r899b5a68c26657a3943f409b5a16d00c0844859a --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs (.../HydraRingConfigurationServiceIntegrationTest.cs) (revision 27ab4d00d005742ce49aa4396e8c822fe040dacc) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs (.../HydraRingConfigurationServiceIntegrationTest.cs) (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -24,6 +24,7 @@ using NUnit.Framework; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics; +using Ringtoets.HydraRing.Calculation.Data.Input.Overtopping; using Ringtoets.HydraRing.Calculation.Services; namespace Ringtoets.HydraRing.Calculation.Test.Integration Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj =================================================================== diff -u -r27ab4d00d005742ce49aa4396e8c822fe040dacc -r899b5a68c26657a3943f409b5a16d00c0844859a --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 27ab4d00d005742ce49aa4396e8c822fe040dacc) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -58,9 +58,10 @@ + - + Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingConfigurationServiceTest.cs =================================================================== diff -u -r16353c197a25732675287dfba8679ab25731ab0c -r899b5a68c26657a3943f409b5a16d00c0844859a --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingConfigurationServiceTest.cs (.../HydraRingConfigurationServiceTest.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingConfigurationServiceTest.cs (.../HydraRingConfigurationServiceTest.cs) (revision 899b5a68c26657a3943f409b5a16d00c0844859a) @@ -350,7 +350,8 @@ { private readonly double roughness; - public HydraRingProfilePointDerivative(double x, double z, double roughness) : base(x, z) + public HydraRingProfilePointDerivative(double x, double z, double roughness) + : base(x, z) { this.roughness = roughness; }