Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs =================================================================== diff -u -ra0c7229c5e088639649bec9d2d64e0e30bad1d48 -rf0bc02e4ddd85caf9c51b909d36c31343398cd71 --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs (.../ReadWaveConditionsCalculationTest.cs) (revision a0c7229c5e088639649bec9d2d64e0e30bad1d48) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs (.../ReadWaveConditionsCalculationTest.cs) (revision f0bc02e4ddd85caf9c51b909d36c31343398cd71) @@ -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.Common.IO.Readers; using Ringtoets.Revetment.IO.Readers; @@ -29,13 +30,89 @@ public class ReadWaveConditionsCalculationTest { [Test] - public void Constructor_ExpectedValues() + public void Constructor_ConstructionPropertiesNull_ThrowArgumentNullException() { // Call - var readItem = new ReadWaveConditionsCalculation(); + TestDelegate test = () => new ReadWaveConditionsCalculation(null); // Assert - Assert.IsInstanceOf(readItem); + var exception = Assert.Throws(test); + Assert.AreEqual("constructionProperties", exception.ParamName); } + + [Test] + public void Constructor_ConstructionPropertiesWithoutValues_PropertiesAreDefault() + { + // Call + var readCalculation = new ReadWaveConditionsCalculation(new ReadWaveConditionsCalculation.ConstructionProperties()); + + // Assert + Assert.IsInstanceOf(readCalculation); + Assert.IsNull(readCalculation.Name); + Assert.IsNull(readCalculation.HydraulicBoundaryLocation); + Assert.IsNull(readCalculation.UpperBoundaryRevetment); + Assert.IsNull(readCalculation.LowerBoundaryRevetment); + Assert.IsNull(readCalculation.UpperBoundaryWaterLevels); + Assert.IsNull(readCalculation.LowerBoundaryWaterLevels); + Assert.IsNull(readCalculation.StepSize); + Assert.IsNull(readCalculation.ForeshoreProfile); + Assert.IsNull(readCalculation.Orientation); + Assert.IsNull(readCalculation.UseDam); + Assert.AreEqual(ReadDamType.None, readCalculation.DamType); + Assert.IsNull(readCalculation.DamHeight); + Assert.IsNull(readCalculation.UseForeshore); + } + + [Test] + public void Constructor_ConstructionPropertiesWithValuesSet_PropertiesAsExpected() + { + // Setup + const string calculationName = "Name of the calculation"; + const string hydraulicBoundaryLocation = "Name of the hydraulic boundary location"; + const double upperBoundaryRevetment = 1.1; + const double lowerBoundaryRevetment = 2.2; + const double upperBoundaryWaterLevels = 3.3; + const double lowerBoundaryWaterLevels = 4.4; + const double stepSize = 5.5; + const string foreshoreProfileName = "Name of the foreshore profile"; + const double orientation = 6.6; + const bool useDam = true; + const ReadDamType damType = ReadDamType.Caisson; + const double damHeight = 7.7; + const bool useForeshore = false; + + // Call + var readPipingCalculation = new ReadWaveConditionsCalculation(new ReadWaveConditionsCalculation.ConstructionProperties + { + Name = calculationName, + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + UpperBoundaryRevetment = upperBoundaryRevetment, + LowerBoundaryRevetment = lowerBoundaryRevetment, + UpperBoundaryWaterLevels = upperBoundaryWaterLevels, + LowerBoundaryWaterLevels = lowerBoundaryWaterLevels, + StepSize = stepSize, + ForeshoreProfile = foreshoreProfileName, + Orientation = orientation, + UseDam = useDam, + DamType = damType, + DamHeight = damHeight, + UseForeshore = useForeshore + }); + + // Assert + Assert.AreEqual(calculationName, readPipingCalculation.Name); + Assert.AreEqual(hydraulicBoundaryLocation, readPipingCalculation.HydraulicBoundaryLocation); + Assert.AreEqual(upperBoundaryRevetment, readPipingCalculation.UpperBoundaryRevetment); + Assert.AreEqual(lowerBoundaryRevetment, readPipingCalculation.LowerBoundaryRevetment); + Assert.AreEqual(upperBoundaryWaterLevels, readPipingCalculation.UpperBoundaryWaterLevels); + Assert.AreEqual(lowerBoundaryWaterLevels, readPipingCalculation.LowerBoundaryWaterLevels); + Assert.AreEqual(stepSize, readPipingCalculation.StepSize); + Assert.AreEqual(foreshoreProfileName, readPipingCalculation.ForeshoreProfile); + Assert.AreEqual(orientation, readPipingCalculation.Orientation); + Assert.AreEqual(useDam, readPipingCalculation.UseDam); + Assert.AreEqual(damType, readPipingCalculation.DamType); + Assert.AreEqual(damHeight, readPipingCalculation.DamHeight); + Assert.AreEqual(useForeshore, readPipingCalculation.UseForeshore); + } } } \ No newline at end of file