Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingOutput.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -rc1096d1261fc843ca6960897afeac1137e1ecd4c --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingOutput.cs (.../PipingOutput.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingOutput.cs (.../PipingOutput.cs) (revision c1096d1261fc843ca6960897afeac1137e1ecd4c) @@ -35,7 +35,7 @@ /// Creates a new instance of . /// /// The container of the properties for the - /// + /// . /// Thrown when the /// is null. public PipingOutput(ConstructionProperties constructionProperties) Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/IReadPipingCalculationItem.cs =================================================================== diff -u -r3793f0710b624c5e9896dd9e8ec91232e5584b23 -rc1096d1261fc843ca6960897afeac1137e1ecd4c --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/IReadPipingCalculationItem.cs (.../IReadPipingCalculationItem.cs) (revision 3793f0710b624c5e9896dd9e8ec91232e5584b23) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/IReadPipingCalculationItem.cs (.../IReadPipingCalculationItem.cs) (revision c1096d1261fc843ca6960897afeac1137e1ecd4c) @@ -24,5 +24,11 @@ /// /// Interface for piping calculation items read via . /// - public interface IReadPipingCalculationItem {} + public interface IReadPipingCalculationItem + { + /// + /// Gets the name of the read piping calculation item. + /// + string Name { get; } + } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/ReadPipingCalculation.cs =================================================================== diff -u -r3793f0710b624c5e9896dd9e8ec91232e5584b23 -rc1096d1261fc843ca6960897afeac1137e1ecd4c --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/ReadPipingCalculation.cs (.../ReadPipingCalculation.cs) (revision 3793f0710b624c5e9896dd9e8ec91232e5584b23) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/ReadPipingCalculation.cs (.../ReadPipingCalculation.cs) (revision c1096d1261fc843ca6960897afeac1137e1ecd4c) @@ -19,10 +19,162 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; + namespace Ringtoets.Piping.IO.Readers { /// /// Class that represents a piping calculation read via . /// - public class ReadPipingCalculation : IReadPipingCalculationItem {} + public class ReadPipingCalculation : IReadPipingCalculationItem + { + /// + /// Creates a new instance of . + /// + /// The container of the properties for the . + /// Thrown when is null. + public ReadPipingCalculation(ConstructionProperties constructionProperties) + { + if (constructionProperties == null) + { + throw new ArgumentNullException(nameof(constructionProperties)); + } + + Name = constructionProperties.Name; + AssessmentLevel = constructionProperties.AssessmentLevel; + HydraulicBoundaryLocation = constructionProperties.HydraulicBoundaryLocation; + SurfaceLine = constructionProperties.SurfaceLine; + EntryPointL = constructionProperties.EntryPointL; + ExitPointL = constructionProperties.ExitPointL; + StochasticSoilModel = constructionProperties.StochasticSoilModel; + StochasticSoilProfile = constructionProperties.StochasticSoilProfile; + PhreaticLevelExitMean = constructionProperties.PhreaticLevelExitMean; + PhreaticLevelExitStandardDeviation = constructionProperties.PhreaticLevelExitStandardDeviation; + DampingFactorExitMean = constructionProperties.DampingFactorExitMean; + DampingFactorExitStandardDeviation = constructionProperties.DampingFactorExitStandardDeviation; + } + + /// + /// Gets the assessment level of the read piping calculation. + /// + public double AssessmentLevel { get; } + + /// + /// Gets the name of the hydraulic boundary location of the read piping calculation. + /// + public string HydraulicBoundaryLocation { get; } + + /// + /// Gets the name of the surface line of the read piping calculation. + /// + public string SurfaceLine { get; } + + /// + /// Gets the l-coordinate of the entry point of the read piping calculation. + /// + public double EntryPointL { get; } + + /// + /// Gets the l-coordinate of the exit point of the read piping calculation. + /// + public double ExitPointL { get; } + + /// + /// Gets the name of the stochastic soil model of the read piping calculation. + /// + public string StochasticSoilModel { get; } + + /// + /// Gets the name of the stochastic soil profile of the read piping calculation. + /// + public string StochasticSoilProfile { get; } + + /// + /// Gets the mean of the phreatic level exit of the read piping calculation. + /// + public double PhreaticLevelExitMean { get; } + + /// + /// Gets the standard deviation of the phreatic level exit of the read piping calculation. + /// + public double PhreaticLevelExitStandardDeviation { get; } + + /// + /// Gets the mean of the damping factor exit of the read piping calculation. + /// + public double DampingFactorExitMean { get; } + + /// + /// Gets the standard deviation of the damping factor exit of the read piping calculation. + /// + public double DampingFactorExitStandardDeviation { get; } + + public string Name { get; } + + /// + /// Class holding the various construction parameters for . + /// + public class ConstructionProperties + { + /// + /// Gets or sets the value for + /// + public string Name { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double AssessmentLevel { internal get; set; } + + /// + /// Gets or sets the value for + /// + public string HydraulicBoundaryLocation { internal get; set; } + + /// + /// Gets or sets the value for + /// + public string SurfaceLine { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double EntryPointL { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double ExitPointL { internal get; set; } + + /// + /// Gets or sets the value for + /// + public string StochasticSoilModel { internal get; set; } + + /// + /// Gets or sets the value for + /// + public string StochasticSoilProfile { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double PhreaticLevelExitMean { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double PhreaticLevelExitStandardDeviation { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double DampingFactorExitMean { internal get; set; } + + /// + /// Gets or sets the value for + /// + public double DampingFactorExitStandardDeviation { internal get; set; } + } + } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/ReadPipingCalculationGroup.cs =================================================================== diff -u -r3793f0710b624c5e9896dd9e8ec91232e5584b23 -rc1096d1261fc843ca6960897afeac1137e1ecd4c --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/ReadPipingCalculationGroup.cs (.../ReadPipingCalculationGroup.cs) (revision 3793f0710b624c5e9896dd9e8ec91232e5584b23) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/ReadPipingCalculationGroup.cs (.../ReadPipingCalculationGroup.cs) (revision c1096d1261fc843ca6960897afeac1137e1ecd4c) @@ -32,5 +32,7 @@ /// Gets the collection of nested . /// public IEnumerable Items { get; private set; } + + public string Name { get; } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/ReadPipingCalculationTest.cs =================================================================== diff -u -r0e8f4dc487699dda631e50c389624f191f8e946d -rc1096d1261fc843ca6960897afeac1137e1ecd4c --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/ReadPipingCalculationTest.cs (.../ReadPipingCalculationTest.cs) (revision 0e8f4dc487699dda631e50c389624f191f8e946d) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/ReadPipingCalculationTest.cs (.../ReadPipingCalculationTest.cs) (revision c1096d1261fc843ca6960897afeac1137e1ecd4c) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using NUnit.Framework; using Ringtoets.Piping.IO.Readers; @@ -28,13 +29,70 @@ public class ReadPipingCalculationTest { [Test] - public void DefaultConstructor_DefaultValues() + public void Constructor_WithoutConstructionProperties_ThrowsArgumentNullException() { // Call - var readPipingCalculation = new ReadPipingCalculation(); + TestDelegate test = () => new ReadPipingCalculation(null); // Assert - Assert.IsInstanceOf(readPipingCalculation); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("constructionProperties", paramName); } + + [Test] + public void Constructor_ConstructionPropertiesWithoutValues_PropertiesAreDefault() + { + // Call + var readPipingCalculation = new ReadPipingCalculation(new ReadPipingCalculation.ConstructionProperties()); + + // Assert + Assert.IsNull(readPipingCalculation.Name); + Assert.AreEqual(0.0, readPipingCalculation.AssessmentLevel); + Assert.IsNull(readPipingCalculation.HydraulicBoundaryLocation); + Assert.IsNull(readPipingCalculation.SurfaceLine); + Assert.AreEqual(0.0, readPipingCalculation.EntryPointL); + Assert.AreEqual(0.0, readPipingCalculation.ExitPointL); + Assert.IsNull(readPipingCalculation.StochasticSoilModel); + Assert.IsNull(readPipingCalculation.StochasticSoilProfile); + Assert.AreEqual(0.0, readPipingCalculation.PhreaticLevelExitMean); + Assert.AreEqual(0.0, readPipingCalculation.PhreaticLevelExitStandardDeviation); + Assert.AreEqual(0.0, readPipingCalculation.DampingFactorExitMean); + Assert.AreEqual(0.0, readPipingCalculation.DampingFactorExitStandardDeviation); + } + + [Test] + public void Constructor_ConstructionPropertiesWithValuesSet_PropertiesAsExpected() + { + // Call + var readPipingCalculation = new ReadPipingCalculation(new ReadPipingCalculation.ConstructionProperties + { + Name = "Name of the calculation", + AssessmentLevel = 1.1, + HydraulicBoundaryLocation = "Name of the hydraulic boundary location", + SurfaceLine = "Name of the surface line", + EntryPointL = 2.2, + ExitPointL = 3.3, + StochasticSoilModel = "Name of the stochastic soil model", + StochasticSoilProfile = "Name of the stochastic soil profile", + PhreaticLevelExitMean = 4.4, + PhreaticLevelExitStandardDeviation = 5.5, + DampingFactorExitMean = 6.6, + DampingFactorExitStandardDeviation = 7.7 + }); + + // Assert + Assert.AreEqual("Name of the calculation", readPipingCalculation.Name); + Assert.AreEqual(1.1, readPipingCalculation.AssessmentLevel); + Assert.AreEqual("Name of the hydraulic boundary location", readPipingCalculation.HydraulicBoundaryLocation); + Assert.AreEqual("Name of the surface line", readPipingCalculation.SurfaceLine); + Assert.AreEqual(2.2, readPipingCalculation.EntryPointL); + Assert.AreEqual(3.3, readPipingCalculation.ExitPointL); + Assert.AreEqual("Name of the stochastic soil model", readPipingCalculation.StochasticSoilModel); + Assert.AreEqual("Name of the stochastic soil profile", readPipingCalculation.StochasticSoilProfile); + Assert.AreEqual(4.4, readPipingCalculation.PhreaticLevelExitMean); + Assert.AreEqual(5.5, readPipingCalculation.PhreaticLevelExitStandardDeviation); + Assert.AreEqual(6.6, readPipingCalculation.DampingFactorExitMean); + Assert.AreEqual(7.7, readPipingCalculation.DampingFactorExitStandardDeviation); + } } } \ No newline at end of file