Index: Ringtoets.sln =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets.sln (.../Ringtoets.sln) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets.sln (.../Ringtoets.sln) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -1092,6 +1092,16 @@ {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ringtoets.HeightStructures.Data.TestUtil", "Ringtoets\HeightStructures\test\Ringtoets.HeightStructures.Data.TestUtil\Ringtoets.HeightStructures.Data.TestUtil.csproj", "{F67E8AE8-1FF0-4680-9817-99E025CD9FF6}" + ProjectSection(ProjectDependencies) = postProject + {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ringtoets.HeightStructures.Data.TestUtil.Test", "Ringtoets\HeightStructures\test\Ringtoets.HeightStructures.Data.TestUtil.Test\Ringtoets.HeightStructures.Data.TestUtil.Test.csproj", "{9995F751-CF25-4BB5-8E90-C9FA0D9227EB}" + ProjectSection(ProjectDependencies) = postProject + {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CreateInstaller|x86 = CreateInstaller|x86 @@ -2733,6 +2743,22 @@ {C10FFCBF-767F-4F3F-B8F9-7D6F4849FF85}.Release|x86.Build.0 = Release|x86 {C10FFCBF-767F-4F3F-B8F9-7D6F4849FF85}.ReleaseForCodeCoverage|x86.ActiveCfg = ReleaseForCodeCoverage|x86 {C10FFCBF-767F-4F3F-B8F9-7D6F4849FF85}.ReleaseForCodeCoverage|x86.Build.0 = ReleaseForCodeCoverage|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.CreateInstaller|x86.ActiveCfg = Release|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.CreateInstallerWithDemoProject|x86.ActiveCfg = Release|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.Debug|x86.ActiveCfg = Debug|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.Debug|x86.Build.0 = Debug|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.Release|x86.ActiveCfg = Release|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.Release|x86.Build.0 = Release|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.ReleaseForCodeCoverage|x86.ActiveCfg = ReleaseForCodeCoverage|x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6}.ReleaseForCodeCoverage|x86.Build.0 = ReleaseForCodeCoverage|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.CreateInstaller|x86.ActiveCfg = Release|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.CreateInstallerWithDemoProject|x86.ActiveCfg = Release|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.Debug|x86.ActiveCfg = Debug|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.Debug|x86.Build.0 = Debug|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.Release|x86.ActiveCfg = Release|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.Release|x86.Build.0 = Release|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.ReleaseForCodeCoverage|x86.ActiveCfg = ReleaseForCodeCoverage|x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB}.ReleaseForCodeCoverage|x86.Build.0 = ReleaseForCodeCoverage|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2902,6 +2928,8 @@ {EE14E459-FEDF-4660-8902-E677F1AA463B} = {E550D725-9C80-4242-8A3F-C1A3E020DEA2} {C2DC616D-80F1-46F3-B6ED-CCCB13F64974} = {E550D725-9C80-4242-8A3F-C1A3E020DEA2} {D3ACB74A-D916-4750-B72F-8276D2E93791} = {E550D725-9C80-4242-8A3F-C1A3E020DEA2} + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6} = {E550D725-9C80-4242-8A3F-C1A3E020DEA2} + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB} = {E550D725-9C80-4242-8A3F-C1A3E020DEA2} {A24FAA09-EF27-48C8-A535-E6D80F49DC5E} = {12202A15-9AF3-493D-B802-D78F6E718937} {41023317-95BB-4147-8154-87B45837E752} = {12202A15-9AF3-493D-B802-D78F6E718937} {B479E3AF-7C34-488C-BB73-D324100D36C9} = {A24FAA09-EF27-48C8-A535-E6D80F49DC5E} Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresCalculation.cs =================================================================== diff -u -r0d12e759b6e46290d83d04a6a5760fe467b339ab -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresCalculation.cs (.../HeightStructuresCalculation.cs) (revision 0d12e759b6e46290d83d04a6a5760fe467b339ab) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresCalculation.cs (.../HeightStructuresCalculation.cs) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -20,7 +20,6 @@ // All rights reserved. using Core.Common.Base; -using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probability; using Ringtoets.HeightStructures.Data.Properties; @@ -39,7 +38,6 @@ { InputParameters = new HeightStructuresInput(); Name = Resources.HeightStructuresCalculation_DefaultName; - AddDemoInput(); } /// @@ -78,16 +76,5 @@ { return Output; } - - private void AddDemoInput() - { - InputParameters.LevelCrestStructure.Mean = (RoundedDouble) 5.74; - InputParameters.StructureNormalOrientation = (RoundedDouble) 115; - InputParameters.AllowedLevelIncreaseStorage.Mean = (RoundedDouble) 1.0; - InputParameters.FlowWidthAtBottomProtection.Mean = (RoundedDouble) 18; - InputParameters.CriticalOvertoppingDischarge.Mean = (RoundedDouble) 1; - InputParameters.WidthFlowApertures.Mean = (RoundedDouble) 18; - InputParameters.DeviationWaveDirection = (RoundedDouble) 0; - } } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresCalculationTest.cs =================================================================== diff -u -r0d12e759b6e46290d83d04a6a5760fe467b339ab -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresCalculationTest.cs (.../HeightStructuresCalculationTest.cs) (revision 0d12e759b6e46290d83d04a6a5760fe467b339ab) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresCalculationTest.cs (.../HeightStructuresCalculationTest.cs) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -42,7 +42,6 @@ Assert.IsNotNull(calculation.InputParameters); Assert.IsNull(calculation.Comments); Assert.IsFalse(calculation.HasOutput); - AssertDemoInput(calculation.InputParameters); } [Test] @@ -122,27 +121,6 @@ Assert.AreSame(calculation.Output, output); } - private void AssertDemoInput(HeightStructuresInput inputParameters) - { - Assert.AreEqual(2, inputParameters.LevelCrestStructure.Mean.NumberOfDecimalPlaces); - Assert.AreEqual(5.74, inputParameters.LevelCrestStructure.Mean.Value); - Assert.AreEqual(2, inputParameters.StructureNormalOrientation.NumberOfDecimalPlaces); - Assert.AreEqual(115, inputParameters.StructureNormalOrientation.Value); - Assert.AreEqual(2, inputParameters.AllowedLevelIncreaseStorage.Mean.NumberOfDecimalPlaces); - Assert.AreEqual(1.0, inputParameters.AllowedLevelIncreaseStorage.Mean.Value); - Assert.AreEqual(2, inputParameters.StorageStructureArea.Mean.NumberOfDecimalPlaces); - Assert.AreEqual(1.0, inputParameters.StorageStructureArea.Mean.Value); - Assert.AreEqual(2, inputParameters.FlowWidthAtBottomProtection.Mean.NumberOfDecimalPlaces); - Assert.AreEqual(18, inputParameters.FlowWidthAtBottomProtection.Mean.Value); - Assert.AreEqual(2, inputParameters.CriticalOvertoppingDischarge.Mean.NumberOfDecimalPlaces); - Assert.AreEqual(1, inputParameters.CriticalOvertoppingDischarge.Mean.Value); - Assert.AreEqual(2, inputParameters.WidthFlowApertures.Mean.NumberOfDecimalPlaces); - Assert.AreEqual(18, inputParameters.WidthFlowApertures.Mean.Value); - Assert.AreEqual(2, inputParameters.DeviationWaveDirection.NumberOfDecimalPlaces); - Assert.AreEqual(0.0, inputParameters.DeviationWaveDirection.Value); - Assert.AreEqual(1.0, inputParameters.FailureProbabilityStructureWithErosion); - } - private class TestHeightStructuresOutput : ProbabilityAssessmentOutput { public TestHeightStructuresOutput() : base(0, 0, 0, 0, 0) {} Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/Properties/AssemblyInfo.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/Properties/AssemblyInfo.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/Properties/AssemblyInfo.cs (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,27 @@ +// 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.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Ringtoets.HeightStructures.Data.TestUtil.Test")] +[assembly: AssemblyProduct("Ringtoets.HeightStructures.Data.TestUtil.Test")] +[assembly: Guid("6eb1114d-1249-425f-8a93-7d71209ee7fb")] \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/Ringtoets.HeightStructures.Data.TestUtil.Test.csproj =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/Ringtoets.HeightStructures.Data.TestUtil.Test.csproj (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/Ringtoets.HeightStructures.Data.TestUtil.Test.csproj (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,92 @@ + + + + Debug + x86 + {9995F751-CF25-4BB5-8E90-C9FA0D9227EB} + Library + Properties + Ringtoets.HeightStructures.Data.TestUtil.Test + Ringtoets.HeightStructures.Data.TestUtil.Test + v4.0 + 512 + + + true + bin\Debug\ + 4 + x86 + MinimumRecommendedRules.ruleset + TRACE;DEBUG + full + + + bin\Release\ + 4 + x86 + MinimumRecommendedRules.ruleset + TRACE + true + + + bin\ReleaseForCodeCoverage\ + TRACE + true + x86 + MinimumRecommendedRules.ruleset + none + + + + ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + + + + + + + Properties\GlobalAssembly.cs + + + + + + + + Copying.licenseheader + + + + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + + + {1C0017D8-35B5-4CA0-8FC7-A83F46DBDC99} + Ringtoets.HeightStructures.Data + + + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6} + Ringtoets.HeightStructures.Data.TestUtil + + + + + \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructureTest.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructureTest.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructureTest.cs (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,88 @@ +// 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 Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.HeightStructures.Data.TestUtil.Test +{ + [TestFixture] + public class TestHeightStructureTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup & Call + var heightStructure = new TestHeightStructure(); + + // Assert + Assert.AreEqual("Test", heightStructure.Name); + Assert.AreEqual("Id", heightStructure.Id); + var location = new Point2D(0, 0); + Assert.AreEqual(location.X, heightStructure.Location.X); + Assert.AreEqual(location.Y, heightStructure.Location.Y); + + Assert.IsInstanceOf(heightStructure.StructureNormalOrientation); + Assert.AreEqual(2, heightStructure.StructureNormalOrientation.NumberOfDecimalPlaces); + Assert.AreEqual(0.12, heightStructure.StructureNormalOrientation.Value); + + NormalDistribution levelCrestStructure = heightStructure.LevelCrestStructure; + Assert.AreEqual(2, levelCrestStructure.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(234.57, levelCrestStructure.Mean.Value); + Assert.AreEqual(2, levelCrestStructure.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.23, levelCrestStructure.StandardDeviation.Value); + + LogNormalDistribution flowWidthAtBottomProtection = heightStructure.FlowWidthAtBottomProtection; + Assert.AreEqual(2, flowWidthAtBottomProtection.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(345.68, flowWidthAtBottomProtection.Mean.Value); + Assert.AreEqual(2, flowWidthAtBottomProtection.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.35, flowWidthAtBottomProtection.StandardDeviation.Value); + + VariationCoefficientLogNormalDistribution criticalOvertoppingDischarge = heightStructure.CriticalOvertoppingDischarge; + Assert.AreEqual(2, criticalOvertoppingDischarge.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(456.79, criticalOvertoppingDischarge.Mean.Value); + Assert.AreEqual(2, criticalOvertoppingDischarge.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.46, criticalOvertoppingDischarge.CoefficientOfVariation.Value); + + VariationCoefficientNormalDistribution widthFlowApertures = heightStructure.WidthFlowApertures; + Assert.AreEqual(2, widthFlowApertures.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(567.89, widthFlowApertures.Mean.Value); + Assert.AreEqual(2, widthFlowApertures.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.57, widthFlowApertures.CoefficientOfVariation.Value); + + Assert.AreEqual(0.67890, heightStructure.FailureProbabilityStructureWithErosion); + + VariationCoefficientLogNormalDistribution storageStructureArea = heightStructure.StorageStructureArea; + Assert.AreEqual(2, storageStructureArea.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(112.22, storageStructureArea.Mean.Value); + Assert.AreEqual(2, storageStructureArea.CoefficientOfVariation.NumberOfDecimalPlaces); + Assert.AreEqual(0.11, storageStructureArea.CoefficientOfVariation.Value); + + LogNormalDistribution allowedLevelIncreaseStorage = heightStructure.AllowedLevelIncreaseStorage; + Assert.AreEqual(2, allowedLevelIncreaseStorage.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(225.34, allowedLevelIncreaseStorage.Mean.Value); + Assert.AreEqual(2, allowedLevelIncreaseStorage.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(0.23, allowedLevelIncreaseStorage.StandardDeviation.Value); + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructuresCalculationTest.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructuresCalculationTest.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/TestHeightStructuresCalculationTest.cs (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,61 @@ +// 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; + +namespace Ringtoets.HeightStructures.Data.TestUtil.Test +{ + [TestFixture] + public class TestHeightStructuresCalculationTest + { + [Test] + public void Constructor_DefaultPropertyValuesAreSet() + { + // Call + var calculation = new TestHeightStructuresCalculation(); + + // Assert + Assert.IsInstanceOf(calculation); + Assert.AreEqual("Nieuwe berekening", calculation.Name); + Assert.IsNotNull(calculation.InputParameters); + Assert.IsNull(calculation.Comments); + Assert.IsFalse(calculation.HasOutput); + + Assert.AreEqual(2, calculation.InputParameters.LevelCrestStructure.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(5.74, calculation.InputParameters.LevelCrestStructure.Mean.Value); + Assert.AreEqual(2, calculation.InputParameters.StructureNormalOrientation.NumberOfDecimalPlaces); + Assert.AreEqual(115, calculation.InputParameters.StructureNormalOrientation.Value); + Assert.AreEqual(2, calculation.InputParameters.AllowedLevelIncreaseStorage.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1.0, calculation.InputParameters.AllowedLevelIncreaseStorage.Mean.Value); + Assert.AreEqual(2, calculation.InputParameters.StorageStructureArea.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1.0, calculation.InputParameters.StorageStructureArea.Mean.Value); + Assert.AreEqual(2, calculation.InputParameters.FlowWidthAtBottomProtection.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(18, calculation.InputParameters.FlowWidthAtBottomProtection.Mean.Value); + Assert.AreEqual(2, calculation.InputParameters.CriticalOvertoppingDischarge.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1, calculation.InputParameters.CriticalOvertoppingDischarge.Mean.Value); + Assert.AreEqual(2, calculation.InputParameters.WidthFlowApertures.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(18, calculation.InputParameters.WidthFlowApertures.Mean.Value); + Assert.AreEqual(2, calculation.InputParameters.DeviationWaveDirection.NumberOfDecimalPlaces); + Assert.AreEqual(0.0, calculation.InputParameters.DeviationWaveDirection.Value); + Assert.AreEqual(1.0, calculation.InputParameters.FailureProbabilityStructureWithErosion); + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/packages.config =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/packages.config (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil.Test/packages.config (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/Properties/AssemblyInfo.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/Properties/AssemblyInfo.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/Properties/AssemblyInfo.cs (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,27 @@ +// 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.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Ringtoets.HeightStructures.Data.TestUtil")] +[assembly: AssemblyProduct("Ringtoets.HeightStructures.Data.TestUtil")] +[assembly: Guid("a7b4d663-f566-460d-963d-15ae9ecf6481")] \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/Ringtoets.HeightStructures.Data.TestUtil.csproj =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/Ringtoets.HeightStructures.Data.TestUtil.csproj (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/Ringtoets.HeightStructures.Data.TestUtil.csproj (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,78 @@ + + + + Debug + x86 + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6} + Library + Properties + Ringtoets.HeightStructures.Data.TestUtil + Ringtoets.HeightStructures.Data.TestUtil + v4.0 + 512 + + + true + bin\Debug\ + 4 + x86 + MinimumRecommendedRules.ruleset + TRACE;DEBUG + full + + + bin\Release\ + 4 + x86 + MinimumRecommendedRules.ruleset + TRACE + true + + + bin\ReleaseForCodeCoverage\ + TRACE + true + x86 + MinimumRecommendedRules.ruleset + none + + + + + + + + Properties\GlobalAssembly.cs + + + + + + + + {3BBFD65B-B277-4E50-AE6D-BD24C3434609} + Core.Common.Base + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + + + {1C0017D8-35B5-4CA0-8FC7-A83F46DBDC99} + Ringtoets.HeightStructures.Data + + + + + Copying.licenseheader + + + + + \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructure.cs (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,33 @@ +// 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 Core.Common.Base.Geometry; + +namespace Ringtoets.HeightStructures.Data.TestUtil +{ + public class TestHeightStructure : HeightStructure + { + public TestHeightStructure() + : base("Test", "Id", new Point2D(0, 0), 0.12345, 234.567, 0.23456, + 345.678, 0.34567, 456.789, 0.45678, 567.890, 0.56789, + 0.67890, 112.223, 0.11222, 225.336, 0.22533) {} + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructuresCalculation.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructuresCalculation.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.TestUtil/TestHeightStructuresCalculation.cs (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -0,0 +1,39 @@ +// 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 Core.Common.Base.Data; + +namespace Ringtoets.HeightStructures.Data.TestUtil +{ + public class TestHeightStructuresCalculation : HeightStructuresCalculation + { + public TestHeightStructuresCalculation() + { + InputParameters.LevelCrestStructure.Mean = (RoundedDouble) 5.74; + InputParameters.StructureNormalOrientation = (RoundedDouble) 115; + InputParameters.AllowedLevelIncreaseStorage.Mean = (RoundedDouble) 1.0; + InputParameters.FlowWidthAtBottomProtection.Mean = (RoundedDouble) 18; + InputParameters.CriticalOvertoppingDischarge.Mean = (RoundedDouble) 1; + InputParameters.WidthFlowApertures.Mean = (RoundedDouble) 18; + InputParameters.DeviationWaveDirection = (RoundedDouble) 0; + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs =================================================================== diff -u -r9050ad5f3a80e630b2fcc092942a40d6343286a0 -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision 9050ad5f3a80e630b2fcc092942a40d6343286a0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -265,7 +265,7 @@ { // Setup var observerMock = mockRepository.StrictMock(); - const int numberProperties = 3; + const int numberProperties = 5; observerMock.Expect(o => o.UpdateObserver()).Repeat.Times(numberProperties); var hydraulicBoundaryLocation = CreateValidHydraulicBoundaryLocation(); var assessmentSectionMock = mockRepository.Stub(); @@ -284,17 +284,23 @@ var random = new Random(100); var newStructureNormalOrientation = new RoundedDouble(2, random.NextDouble()); + HeightStructure newHeightStructure = CreateValidHeightStructure(); + ForeshoreProfile newForeshoreProfile = CreateValidForeshoreProfile(); // Call + properties.HeightStructure = newHeightStructure; properties.StructureNormalOrientation = newStructureNormalOrientation; properties.FailureProbabilityStructureWithErosion = "1e-2"; properties.HydraulicBoundaryLocation = hydraulicBoundaryLocation; + properties.ForeshoreProfile = newForeshoreProfile; // Assert + Assert.AreSame(newHeightStructure, properties.HeightStructure); Assert.AreEqual(newStructureNormalOrientation, properties.StructureNormalOrientation); Assert.AreEqual(0.01, input.FailureProbabilityStructureWithErosion); Assert.AreEqual("1/100", properties.FailureProbabilityStructureWithErosion); Assert.AreSame(hydraulicBoundaryLocation, properties.HydraulicBoundaryLocation); + Assert.AreSame(newForeshoreProfile, properties.ForeshoreProfile); mockRepository.VerifyAll(); } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Ringtoets.HeightStructures.Forms.Test.csproj =================================================================== diff -u -r0a6fd2fa18908a63fc029833ea3735709ebd5829 -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Ringtoets.HeightStructures.Forms.Test.csproj (.../Ringtoets.HeightStructures.Forms.Test.csproj) (revision 0a6fd2fa18908a63fc029833ea3735709ebd5829) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Ringtoets.HeightStructures.Forms.Test.csproj (.../Ringtoets.HeightStructures.Forms.Test.csproj) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -156,6 +156,10 @@ {9AF85B2B-8D78-43C5-9542-FBB3A14EAB36} Ringtoets.HeightStructures.Plugin + + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6} + Ringtoets.HeightStructures.Data.TestUtil + Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r7164a642dc83ca7a1fd78513cbff9da53c052602 -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 7164a642dc83ca7a1fd78513cbff9da53c052602) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -38,6 +38,7 @@ using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.HeightStructures.Data; +using Ringtoets.HeightStructures.Data.TestUtil; using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.Plugin; using Ringtoets.HeightStructures.Plugin.Properties; @@ -1162,14 +1163,6 @@ CollectionAssert.DoesNotContain(parentGroup.Children, group); } - private class TestHeightStructure : HeightStructure - { - public TestHeightStructure() - : base("Test", "Id", new Point2D(0, 0), 0.12345, 234.567, 0.23456, - 345.678, 0.34567, 456.789, 0.45678, 567.890, 0.56789, - 0.67890, 112.223, 0.11222, 225.336, 0.22533) {} - } - public override void TearDown() { plugin.Dispose(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u -r975eb14461865f3e93dfd8224fc9f10fd71b0adb -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision 975eb14461865f3e93dfd8224fc9f10fd71b0adb) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -32,8 +32,8 @@ using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.IO.FileImporters; using Ringtoets.HeightStructures.Data; +using Ringtoets.HeightStructures.Data.TestUtil; using Ringtoets.HeightStructures.Service; -using Ringtoets.HydraRing.Calculation.Calculator.Factory; using Ringtoets.HydraRing.Calculation.TestUtil.Calculator; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; @@ -244,7 +244,7 @@ new Point2D(1, 1) })); - var calculation = new HeightStructuresCalculation + var calculation = new TestHeightStructuresCalculation { InputParameters = { Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/Ringtoets.HeightStructures.Integration.Test.csproj =================================================================== diff -u -r975eb14461865f3e93dfd8224fc9f10fd71b0adb -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/Ringtoets.HeightStructures.Integration.Test.csproj (.../Ringtoets.HeightStructures.Integration.Test.csproj) (revision 975eb14461865f3e93dfd8224fc9f10fd71b0adb) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/Ringtoets.HeightStructures.Integration.Test.csproj (.../Ringtoets.HeightStructures.Integration.Test.csproj) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -104,6 +104,10 @@ {20DD96D3-001E-407A-AE2E-432887088F1F} Ringtoets.HeightStructures.Service + + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6} + Ringtoets.HeightStructures.Data.TestUtil + Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationServiceTest.cs =================================================================== diff -u -r975eb14461865f3e93dfd8224fc9f10fd71b0adb -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationServiceTest.cs (.../HeightStructuresCalculationServiceTest.cs) (revision 975eb14461865f3e93dfd8224fc9f10fd71b0adb) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationServiceTest.cs (.../HeightStructuresCalculationServiceTest.cs) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -30,14 +30,15 @@ using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.HeightStructures.Data; +using Ringtoets.HeightStructures.Data.TestUtil; using Ringtoets.HydraRing.Data; namespace Ringtoets.HeightStructures.Service.Test { [TestFixture] public class HeightStructuresCalculationServiceTest { - private readonly static string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); + private static readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); [Test] public void Validate_InvalidCalculationInputValidHydraulicBoundaryDatabase_LogsErrorAndReturnsFalse() @@ -167,7 +168,7 @@ new Point2D(1, 1) })); - var calculation = new HeightStructuresCalculation + var calculation = new TestHeightStructuresCalculation { InputParameters = { Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/Ringtoets.HeightStructures.Service.Test.csproj =================================================================== diff -u -r171bef69ca437d9501abcfe0ab858c6e7ce89061 -rc3c2bba57ff003c569aefa73e42ac6122fcf5bfa --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/Ringtoets.HeightStructures.Service.Test.csproj (.../Ringtoets.HeightStructures.Service.Test.csproj) (revision 171bef69ca437d9501abcfe0ab858c6e7ce89061) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/Ringtoets.HeightStructures.Service.Test.csproj (.../Ringtoets.HeightStructures.Service.Test.csproj) (revision c3c2bba57ff003c569aefa73e42ac6122fcf5bfa) @@ -94,6 +94,10 @@ {20DD96D3-001E-407A-AE2E-432887088F1F} Ringtoets.HeightStructures.Service + + {F67E8AE8-1FF0-4680-9817-99E025CD9FF6} + Ringtoets.HeightStructures.Data.TestUtil +