Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicLocationConfigurationSettings.cs =================================================================== diff -u -ra09830acfa5617cc5ece25e8f3ffe8b234255710 -r2dd8647214dce19cf7784d03cb5e31a10e454c9d --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicLocationConfigurationSettings.cs (.../HydraulicLocationConfigurationSettings.cs) (revision a09830acfa5617cc5ece25e8f3ffe8b234255710) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicLocationConfigurationSettings.cs (.../HydraulicLocationConfigurationSettings.cs) (revision 2dd8647214dce19cf7784d03cb5e31a10e454c9d) @@ -1,13 +1,19 @@ using System; -namespace Ringtoets.Common.Data.Hydraulics { +namespace Ringtoets.Common.Data.Hydraulics +{ /// /// Class which holds information about the hydraulic /// location configuration settings. /// public class HydraulicLocationConfigurationSettings { /// + /// Gets the file path. + /// + public string FilePath { get; private set; } + + /// /// Gets the scenario name. /// public string ScenarioName { get; private set; } @@ -55,6 +61,7 @@ /// /// Sets values to the . /// + /// The file path. /// The name of the scenario. /// The year. /// The scope. @@ -66,10 +73,15 @@ /// The comment. /// Thrown when /// or are null. - public void SetValues(string scenarioName, int year, string scope, + public void SetValues(string filePath, string scenarioName, int year, string scope, string seaLevel, string riverDischarge, string lakeLevel, string windDirection, string windSpeed, string comment) { + if (filePath == null) + { + throw new ArgumentNullException(nameof(filePath)); + } + if (scenarioName == null) { throw new ArgumentNullException(nameof(scenarioName)); @@ -80,6 +92,7 @@ throw new ArgumentNullException(nameof(scope)); } + FilePath = filePath; ScenarioName = scenarioName; Year = year; Scope = scope; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicLocationConfigurationSettingsTest.cs =================================================================== diff -u -ra09830acfa5617cc5ece25e8f3ffe8b234255710 -r2dd8647214dce19cf7784d03cb5e31a10e454c9d --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicLocationConfigurationSettingsTest.cs (.../HydraulicLocationConfigurationSettingsTest.cs) (revision a09830acfa5617cc5ece25e8f3ffe8b234255710) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/HydraulicLocationConfigurationSettingsTest.cs (.../HydraulicLocationConfigurationSettingsTest.cs) (revision 2dd8647214dce19cf7784d03cb5e31a10e454c9d) @@ -14,6 +14,7 @@ var settings = new HydraulicLocationConfigurationSettings(); // Assert + Assert.IsNull(settings.FilePath); Assert.IsNull(settings.ScenarioName); Assert.Zero(settings.Year); Assert.IsNull(settings.Scope); @@ -26,10 +27,38 @@ } [Test] + public void SetValues_FilePathNull_ThrowsArgumentNullException() + { + // Setup + var random = new Random(21); + const string scenarioName = "FilePath"; + int year = random.Next(); + const string scope = "Scope"; + const string seaLevel = "SeaLevel"; + const string riverDischarge = "RiverDischarge"; + const string lakeLevel = "LakeLevel"; + const string windDirection = "WindDirection"; + const string windSpeed = "WindSpeed"; + const string comment = "Comment"; + + var settings = new HydraulicLocationConfigurationSettings(); + + // Call + TestDelegate call = () => settings.SetValues(null, scenarioName, year, scope, + seaLevel, riverDischarge, lakeLevel, + windDirection, windSpeed, comment); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("filePath", exception.ParamName); + } + + [Test] public void SetValues_ScenarioNameNull_ThrowsArgumentNullException() { // Setup var random = new Random(21); + const string filePath = "FilePath"; int year = random.Next(); const string scope = "Scope"; const string seaLevel = "SeaLevel"; @@ -42,7 +71,7 @@ var settings = new HydraulicLocationConfigurationSettings(); // Call - TestDelegate call = () => settings.SetValues(null, year, scope, + TestDelegate call = () => settings.SetValues(filePath, null, year, scope, seaLevel, riverDischarge, lakeLevel, windDirection, windSpeed, comment); @@ -56,6 +85,7 @@ { // Setup var random = new Random(21); + const string filePath = "FilePath"; const string scenarioName = "ScenarioName"; int year = random.Next(); const string seaLevel = "SeaLevel"; @@ -68,7 +98,7 @@ var settings = new HydraulicLocationConfigurationSettings(); // Call - TestDelegate call = () => settings.SetValues(scenarioName, year, null, + TestDelegate call = () => settings.SetValues(filePath, scenarioName, year, null, seaLevel, riverDischarge, lakeLevel, windDirection, windSpeed, comment); @@ -82,6 +112,7 @@ { // Setup var random = new Random(21); + const string filePath = "FilePath"; const string scenarioName = "ScenarioName"; int year = random.Next(); const string scope = "Scope"; @@ -95,7 +126,7 @@ var settings = new HydraulicLocationConfigurationSettings(); // Call - settings.SetValues(scenarioName, year, scope, + settings.SetValues(filePath, scenarioName, year, scope, seaLevel, riverDischarge, lakeLevel, windDirection, windSpeed, comment);