Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Exporters/StabilityPointStructuresCalculationConfigurationWriter.cs
===================================================================
diff -u
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Exporters/StabilityPointStructuresCalculationConfigurationWriter.cs (revision 0)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Exporters/StabilityPointStructuresCalculationConfigurationWriter.cs (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -0,0 +1,54 @@
+// 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;
+using System.Xml;
+using Ringtoets.Common.IO.Writers;
+
+namespace Ringtoets.StabilityPointStructures.IO.Exporters
+{
+ ///
+ /// Writer for writing in XML format to file.
+ ///
+ public class StabilityPointStructuresCalculationConfigurationWriter : StructureCalculationConfigurationWriter
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The path of the file to write to.
+ /// Thrown when is invalid.
+ /// A valid path:
+ ///
+ /// is not empty or null,
+ /// does not consist out of only whitespace characters,
+ /// does not contain an invalid character,
+ /// does not end with a directory or path separator (empty file name).
+ ///
+ public StabilityPointStructuresCalculationConfigurationWriter(string filePath) : base(filePath) {}
+
+ protected override void WriteSpecificStochasts(StabilityPointStructuresCalculationConfiguration configuration, XmlWriter writer)
+ {
+ WriteDistributionWhenAvailable(writer,
+ StabilityPointStructuresConfigurationSchemaIdentifiers.BankWidthStochastName,
+ configuration.BankWidth);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Ringtoets.StabilityPointStructures.IO.csproj
===================================================================
diff -u -r5da2eede50bb14cb73fc2ea8a122c03244c428a2 -rf53bbfd52a477ea865f97ce02525b1fe96d05a30
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Ringtoets.StabilityPointStructures.IO.csproj (.../Ringtoets.StabilityPointStructures.IO.csproj) (revision 5da2eede50bb14cb73fc2ea8a122c03244c428a2)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/Ringtoets.StabilityPointStructures.IO.csproj (.../Ringtoets.StabilityPointStructures.IO.csproj) (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -38,14 +38,17 @@
+
Properties\GlobalAssembly.cs
+
+
@@ -76,7 +79,6 @@
-
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresCalculationConfiguration.cs
===================================================================
diff -u -r5da2eede50bb14cb73fc2ea8a122c03244c428a2 -rf53bbfd52a477ea865f97ce02525b1fe96d05a30
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresCalculationConfiguration.cs (.../StabilityPointStructuresCalculationConfiguration.cs) (revision 5da2eede50bb14cb73fc2ea8a122c03244c428a2)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresCalculationConfiguration.cs (.../StabilityPointStructuresCalculationConfiguration.cs) (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -35,5 +35,10 @@
/// The name of the .
/// Thrown when is null.
public StabilityPointStructuresCalculationConfiguration(string name) : base(name) {}
+
+ ///
+ /// Gets or sets the stochast configuration for the bank width of the structure.
+ ///
+ public MeanStandardDeviationStochastConfiguration BankWidth { get; set; }
}
}
\ No newline at end of file
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresConfigurationSchemaIdentifiers.cs
===================================================================
diff -u
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresConfigurationSchemaIdentifiers.cs (revision 0)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.IO/StabilityPointStructuresConfigurationSchemaIdentifiers.cs (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -0,0 +1,34 @@
+// 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.StabilityPointStructures.IO
+{
+ ///
+ /// Container of identifiers related to stability point structures calculation configuration schema definitions.
+ ///
+ public static class StabilityPointStructuresConfigurationSchemaIdentifiers
+ {
+ ///
+ /// The identifier for the bank width stochast name.
+ ///
+ public const string BankWidthStochastName = "bermbreedte";
+ }
+}
\ No newline at end of file
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Exporters/StabilityPointStructuresCalculationConfigurationWriterTest.cs
===================================================================
diff -u
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Exporters/StabilityPointStructuresCalculationConfigurationWriterTest.cs (revision 0)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Exporters/StabilityPointStructuresCalculationConfigurationWriterTest.cs (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -0,0 +1,45 @@
+// 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.Common.IO.TestUtil;
+using Ringtoets.Common.IO.Writers;
+using Ringtoets.StabilityPointStructures.IO.Exporters;
+
+namespace Ringtoets.StabilityPointStructures.IO.Test.Exporters
+{
+ [TestFixture]
+ public class StabilityPointStructuresCalculationConfigurationWriterTest
+ : CustomSchemaCalculationConfigurationWriterDesignGuidelinesTestFixture<
+ StabilityPointStructuresCalculationConfigurationWriter,
+ StabilityPointStructuresCalculationConfiguration>
+ {
+ protected override StabilityPointStructuresCalculationConfigurationWriter CreateWriterInstance(string filePath)
+ {
+ return new StabilityPointStructuresCalculationConfigurationWriter(filePath);
+ }
+
+ protected override void AssertDefaultConstructedInstance(StabilityPointStructuresCalculationConfigurationWriter writer)
+ {
+ Assert.IsInstanceOf>(writer);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Ringtoets.StabilityPointStructures.IO.Test.csproj
===================================================================
diff -u -r5da2eede50bb14cb73fc2ea8a122c03244c428a2 -rf53bbfd52a477ea865f97ce02525b1fe96d05a30
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Ringtoets.StabilityPointStructures.IO.Test.csproj (.../Ringtoets.StabilityPointStructures.IO.Test.csproj) (revision 5da2eede50bb14cb73fc2ea8a122c03244c428a2)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/Ringtoets.StabilityPointStructures.IO.Test.csproj (.../Ringtoets.StabilityPointStructures.IO.Test.csproj) (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -47,9 +47,11 @@
Properties\GlobalAssembly.cs
+
+
@@ -74,6 +76,10 @@
{52BA7627-CBAB-4209-BE77-3B5F31378277}Ringtoets.Common.IO
+
+ {33508D7C-1602-4C0D-8503-73AAE98C19E5}
+ Ringtoets.Common.IO.TestUtil
+ {3D4B9740-8348-4434-8D77-B611FC6EE57F}Ringtoets.StabilityPointStructures.Data
@@ -84,7 +90,6 @@
-
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresCalculationConfigurationTest.cs
===================================================================
diff -u -r5da2eede50bb14cb73fc2ea8a122c03244c428a2 -rf53bbfd52a477ea865f97ce02525b1fe96d05a30
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresCalculationConfigurationTest.cs (.../StabilityPointStructuresCalculationConfigurationTest.cs) (revision 5da2eede50bb14cb73fc2ea8a122c03244c428a2)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresCalculationConfigurationTest.cs (.../StabilityPointStructuresCalculationConfigurationTest.cs) (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -52,5 +52,19 @@
Assert.IsInstanceOf(configuration);
Assert.AreEqual(name, configuration.Name);
}
+
+ [Test]
+ public void Properties_SetNewValues_NewValuesSet()
+ {
+ // Setup
+ var bankWidth = new MeanStandardDeviationStochastConfiguration();
+ var configuration = new StabilityPointStructuresCalculationConfiguration("some name");
+
+ // Call
+ configuration.BankWidth = bankWidth;
+
+ // Assert
+ Assert.AreSame(bankWidth, configuration.BankWidth);
+ }
}
}
\ No newline at end of file
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresConfigurationSchemaIdentifiersTest.cs
===================================================================
diff -u
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresConfigurationSchemaIdentifiersTest.cs (revision 0)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.IO.Test/StabilityPointStructuresConfigurationSchemaIdentifiersTest.cs (revision f53bbfd52a477ea865f97ce02525b1fe96d05a30)
@@ -0,0 +1,36 @@
+// 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.StabilityPointStructures.IO.Test
+{
+ [TestFixture]
+ public class StabilityPointStructuresConfigurationSchemaIdentifiersTest
+ {
+ [Test]
+ public void Properties_Always_ExpectedValues()
+ {
+ // Assert
+ Assert.AreEqual("bermbreedte", StabilityPointStructuresConfigurationSchemaIdentifiers.BankWidthStochastName);
+ }
+ }
+}
\ No newline at end of file