Index: Ringtoets/Common/src/Ringtoets.Common.IO/FailureMechanismSectionReader.cs =================================================================== diff -u -r16bd8076863c03907abeee60b16704aba1bdb1a0 -r90555cd02cecb2d187e60946deb3d5415cbb3b18 --- Ringtoets/Common/src/Ringtoets.Common.IO/FailureMechanismSectionReader.cs (.../FailureMechanismSectionReader.cs) (revision 16bd8076863c03907abeee60b16704aba1bdb1a0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FailureMechanismSectionReader.cs (.../FailureMechanismSectionReader.cs) (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -30,7 +30,6 @@ using Core.Components.Gis.Features; using Core.Components.Gis.IO.Readers; using Ringtoets.Common.Data.FailureMechanism; -using CoreCommonUtilsResources = Core.Common.Utils.Properties.Resources; using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources; namespace Ringtoets.Common.IO Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationExporter.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationExporter.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationExporter.cs (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -0,0 +1,28 @@ +// 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.GrassCoverErosionOutwards.IO +{ + public class GrassCoverErosionOutwardsConfigurationExporter + { + + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationWriter.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationWriter.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationWriter.cs (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -0,0 +1,35 @@ +// 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.Xml; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Revetment.IO; + +namespace Ringtoets.GrassCoverErosionOutwards.IO +{ + public class GrassCoverErosionOutwardsConfigurationWriter : WaveConditionsInputConfigurationWriter + { + protected override void WriteCalculation(GrassCoverErosionOutwardsWaveConditionsCalculation calculation, XmlWriter writer) + { + WriteCalculation(calculation.Name, calculation.InputParameters, writer); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/Ringtoets.GrassCoverErosionOutwards.IO.csproj =================================================================== diff -u -r23d1e296e2da4364fbfe346e68d582dfcf966bb0 -r90555cd02cecb2d187e60946deb3d5415cbb3b18 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/Ringtoets.GrassCoverErosionOutwards.IO.csproj (.../Ringtoets.GrassCoverErosionOutwards.IO.csproj) (revision 23d1e296e2da4364fbfe346e68d582dfcf966bb0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/Ringtoets.GrassCoverErosionOutwards.IO.csproj (.../Ringtoets.GrassCoverErosionOutwards.IO.csproj) (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -34,11 +34,14 @@ + Properties\GlobalAssembly.cs + + @@ -63,6 +66,11 @@ Ringtoets.Common.Data False + + {52ba7627-cbab-4209-be77-3b5f31378277} + Ringtoets.Common.IO + False + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} Ringtoets.Revetment.Data Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationExporterTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationExporterTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationExporterTest.cs (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -0,0 +1,31 @@ +// 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.GrassCoverErosionOutwards.IO.Test +{ + [TestFixture] + public class GrassCoverErosionOutwardsConfigurationExporterTest + { + + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationWriterTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationWriterTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationWriterTest.cs (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -0,0 +1,109 @@ +// 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.IO; +using System.Xml; +using Core.Common.Base.Data; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.IO; + +namespace Ringtoets.GrassCoverErosionOutwards.IO.Test +{ + [TestFixture] + public class GrassCoverErosionOutwardsConfigurationWriterTest + { + [Test] + public void Constructor_Always_CreateWaveConditionsInputWriter() + { + // Call + var writer = new GrassCoverErosionOutwardsConfigurationWriter(); + + // Assert + Assert.IsInstanceOf>(writer); + } + + [Test] + public void Write_GroupWithCalculationAndOtherGroup_WritesOutCalculationAndGroupToFile() + { + // Setup + string filePath = TestHelper.GetScratchPadPath("Write_GroupWithCalculationAndOtherGroup.xml"); + string expectedXmlFilePath = TestHelper.GetTestDataPath( + TestDataPath.Ringtoets.GrassCoverErosionOutwards.IO, + Path.Combine(nameof(GrassCoverErosionOutwardsConfigurationWriter), "calculationAndGroupWithNesting.xml")); + + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + { + Name = "Berekening 1", + InputParameters = + { + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation("hr_locatie_2"), + UpperBoundaryRevetment = (RoundedDouble) 2.5, + LowerBoundaryRevetment = (RoundedDouble) 1.3, + UpperBoundaryWaterLevels = (RoundedDouble) 2.2, + LowerBoundaryWaterLevels = (RoundedDouble) (-0.2), + StepSize = WaveConditionsInputStepSize.Two, + ForeshoreProfile = new TestForeshoreProfile("profiel2"), + Orientation = (RoundedDouble) 12.3, + UseForeshore = true, + UseBreakWater = true, + BreakWater = + { + Height = (RoundedDouble) 2.11, + Type = BreakWaterType.Wall + } + } + }; + + var calculationGroup = new CalculationGroup("NestedGroup", false); + var rootGroup = new CalculationGroup + { + Children = + { + calculation, + calculationGroup + } + }; + try + { + var writer = new GrassCoverErosionOutwardsConfigurationWriter(); + + // Call + writer.Write(rootGroup, filePath); + + // Assert + string actualXml = File.ReadAllText(filePath); + string expectedXml = File.ReadAllText(expectedXmlFilePath); + + Assert.AreEqual(expectedXml, actualXml); + } + finally + { + File.Delete(filePath); + } + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/Ringtoets.GrassCoverErosionOutwards.IO.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r90555cd02cecb2d187e60946deb3d5415cbb3b18 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/Ringtoets.GrassCoverErosionOutwards.IO.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.IO.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/Ringtoets.GrassCoverErosionOutwards.IO.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.IO.Test.csproj) (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -44,11 +44,14 @@ + Properties\GlobalAssembly.cs + + @@ -71,6 +74,18 @@ {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data + + {52ba7627-cbab-4209-be77-3b5f31378277} + Ringtoets.Common.IO + + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + + + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} + Ringtoets.Revetment.Data + {E3347B16-BB18-41C1-8D34-FBCBF20DB695} Ringtoets.Revetment.IO Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/test-data/GrassCoverErosionOutwardsConfigurationWriter/calculationAndGroupWithNesting.xml =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/test-data/GrassCoverErosionOutwardsConfigurationWriter/calculationAndGroupWithNesting.xml (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/test-data/GrassCoverErosionOutwardsConfigurationWriter/calculationAndGroupWithNesting.xml (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -0,0 +1,20 @@ + + + + hr_locatie_2 + 2.5 + 1.3 + 2.2 + -0.2 + 2.0 + profiel2 + 12.3 + + true + verticalewand + 2.11 + true + + + + \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputConfigurationSchemaIdentifiers.cs =================================================================== diff -u -r0e700dc5121b8f56c96d1d552056bbe6ebe29300 -r90555cd02cecb2d187e60946deb3d5415cbb3b18 --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputConfigurationSchemaIdentifiers.cs (.../WaveConditionsInputConfigurationSchemaIdentifiers.cs) (revision 0e700dc5121b8f56c96d1d552056bbe6ebe29300) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputConfigurationSchemaIdentifiers.cs (.../WaveConditionsInputConfigurationSchemaIdentifiers.cs) (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -90,5 +90,24 @@ /// The tag of elements containing the value indicating whether to use break water. /// internal const string UseForeshore = "voorlandgebruiken"; + + /// + /// The possible content of the element indicating a + /// caisson type of break water. + /// + internal const string BreakWaterCaisson = "caisson"; + + /// + /// The possible content of the element indicating a + /// dam type of break water. + /// + internal const string BreakWaterDam = "havendam"; + + /// + /// The possible content of the element indicating a + /// wall type of break water. + /// + internal const string BreakWaterWall = "verticalewand"; + } } \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputConfigurationWriter.cs =================================================================== diff -u -r0e700dc5121b8f56c96d1d552056bbe6ebe29300 -r90555cd02cecb2d187e60946deb3d5415cbb3b18 --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputConfigurationWriter.cs (.../WaveConditionsInputConfigurationWriter.cs) (revision 0e700dc5121b8f56c96d1d552056bbe6ebe29300) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/WaveConditionsInputConfigurationWriter.cs (.../WaveConditionsInputConfigurationWriter.cs) (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -103,11 +103,11 @@ switch (type) { case BreakWaterType.Caisson: - return "caisson"; + return WaveConditionsInputConfigurationSchemaIdentifiers.BreakWaterCaisson; case BreakWaterType.Dam: - return "havendam"; + return WaveConditionsInputConfigurationSchemaIdentifiers.BreakWaterDam; case BreakWaterType.Wall: - return "verticalewand"; + return WaveConditionsInputConfigurationSchemaIdentifiers.BreakWaterWall; default: throw new InvalidEnumArgumentException(nameof(type), (int) type, typeof(BreakWaterType)); } Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsInputConfigurationWriterTest.cs =================================================================== diff -u -r0e700dc5121b8f56c96d1d552056bbe6ebe29300 -r90555cd02cecb2d187e60946deb3d5415cbb3b18 --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsInputConfigurationWriterTest.cs (.../WaveConditionsInputConfigurationWriterTest.cs) (revision 0e700dc5121b8f56c96d1d552056bbe6ebe29300) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsInputConfigurationWriterTest.cs (.../WaveConditionsInputConfigurationWriterTest.cs) (revision 90555cd02cecb2d187e60946deb3d5415cbb3b18) @@ -28,7 +28,6 @@ using Ringtoets.Common.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; -using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.IO.Writers; using Ringtoets.Revetment.Data; @@ -74,22 +73,23 @@ UseBreakWater = true, BreakWater = { - Height = (RoundedDouble) 1.234, + Height = (RoundedDouble) 1.23, Type = BreakWaterType.Dam } } }; - // Call try { - using (XmlWriter writer = XmlWriter.Create(filePath, new XmlWriterSettings + using (XmlWriter xmlWriter = XmlWriter.Create(filePath, new XmlWriterSettings { Indent = true })) { + var writer = new SimpleWaveConditionsInputConfigurationWriter(); + // Call - new SimpleWaveConditionsInputConfigurationWriter().PublicWriteCalculation(calculation, writer); + writer.PublicWriteCalculation(calculation, xmlWriter); } // Assert @@ -102,8 +102,6 @@ { File.Delete(filePath); } - - // Assert } }