Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.IO/Exporters/GrassCoverErosionOutwardsWaveConditionsExporter.cs =================================================================== diff -u -r5bc15e683e6b36838c0fb3f46929abf002e70105 -rd1ed7dab7b257ddeb6cec7168649edfd8d0fbe07 --- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.IO/Exporters/GrassCoverErosionOutwardsWaveConditionsExporter.cs (.../GrassCoverErosionOutwardsWaveConditionsExporter.cs) (revision 5bc15e683e6b36838c0fb3f46929abf002e70105) +++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.IO/Exporters/GrassCoverErosionOutwardsWaveConditionsExporter.cs (.../GrassCoverErosionOutwardsWaveConditionsExporter.cs) (revision d1ed7dab7b257ddeb6cec7168649edfd8d0fbe07) @@ -60,7 +60,7 @@ { exportableWaveConditions.AddRange( ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection( - calculation.Name, calculation.InputParameters, calculation.Output.WaveRunUpOutput)); + calculation.Name, calculation.InputParameters, calculation.Output.WaveRunUpOutput, CoverType.GrassWaveRunUp)); } return exportableWaveConditions; Index: Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditionsFactory.cs =================================================================== diff -u -re7f106928d957ff6a4c163a9d3ab4eee5fd466a4 -rd1ed7dab7b257ddeb6cec7168649edfd8d0fbe07 --- Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditionsFactory.cs (.../ExportableWaveConditionsFactory.cs) (revision e7f106928d957ff6a4c163a9d3ab4eee5fd466a4) +++ Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditionsFactory.cs (.../ExportableWaveConditionsFactory.cs) (revision d1ed7dab7b257ddeb6cec7168649edfd8d0fbe07) @@ -38,21 +38,28 @@ /// The name of the calculation to which the belong. /// The used in the calculations. /// The resulting from the calculations. + /// The that the represents. /// A collection of . /// Thrown when any parameter is null. /// Thrown when /// is null in . public static IEnumerable CreateExportableWaveConditionsCollection( string name, FailureMechanismCategoryWaveConditionsInput waveConditionsInput, - IEnumerable output) + IEnumerable output, + CoverType coverType) { if (waveConditionsInput == null) { throw new ArgumentNullException(nameof(waveConditionsInput)); } - return CreateExportableWaveConditionsCollection(name, waveConditionsInput, output, CoverType.GrassWaveRunUp, + if (coverType == null) + { + throw new ArgumentNullException(nameof(coverType)); + } + + return CreateExportableWaveConditionsCollection(name, waveConditionsInput, output, coverType, GetCategoryBoundaryName(waveConditionsInput.CategoryType)); } Index: Riskeer/Revetment/test/Riskeer.Revetment.IO.Test/WaveConditions/ExportableWaveConditionsFactoryTest.cs =================================================================== diff -u -re7f106928d957ff6a4c163a9d3ab4eee5fd466a4 -rd1ed7dab7b257ddeb6cec7168649edfd8d0fbe07 --- Riskeer/Revetment/test/Riskeer.Revetment.IO.Test/WaveConditions/ExportableWaveConditionsFactoryTest.cs (.../ExportableWaveConditionsFactoryTest.cs) (revision e7f106928d957ff6a4c163a9d3ab4eee5fd466a4) +++ Riskeer/Revetment/test/Riskeer.Revetment.IO.Test/WaveConditions/ExportableWaveConditionsFactoryTest.cs (.../ExportableWaveConditionsFactoryTest.cs) (revision d1ed7dab7b257ddeb6cec7168649edfd8d0fbe07) @@ -49,7 +49,7 @@ // Call TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(null, new FailureMechanismCategoryWaveConditionsInput(), - waveConditionsOutputCollection); + waveConditionsOutputCollection, CoverType.GrassWaveRunUp); // Assert var exception = Assert.Throws(call); @@ -61,8 +61,9 @@ { // Call TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", - null, - waveConditionsOutputCollection); + (FailureMechanismCategoryWaveConditionsInput) null, + waveConditionsOutputCollection, + CoverType.GrassWaveRunUp); // Assert var exception = Assert.Throws(call); @@ -75,16 +76,32 @@ // Call TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", new FailureMechanismCategoryWaveConditionsInput(), - null); + null, + CoverType.GrassWaveRunUp); // Assert var exception = Assert.Throws(call); Assert.AreEqual("output", exception.ParamName); } [Test] - public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_ValidDataWithCoverType_ReturnsValidCollection() + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_CoverTypeNull_ThrowArgumentNullException() { + // Call + TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", + new FailureMechanismCategoryWaveConditionsInput(), + waveConditionsOutputCollection, + null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("coverType", exception.ParamName); + } + + [Test] + [TestCaseSource(nameof(GetCoverTypes))] + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_ValidDataWithCoverType_ReturnsValidCollection(CoverType coverType) + { // Setup var waveConditionsInput = new FailureMechanismCategoryWaveConditionsInput { @@ -98,7 +115,8 @@ ExportableWaveConditions[] exportableWaveConditionsCollection = ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("ewcName", waveConditionsInput, - waveConditionsOutputCollection).ToArray(); + waveConditionsOutputCollection, + coverType).ToArray(); // Assert Assert.AreEqual(1, exportableWaveConditionsCollection.Length); @@ -110,7 +128,7 @@ Assert.AreEqual("id", exportableWaveConditions.ForeshoreId); Assert.AreEqual(false, exportableWaveConditions.UseBreakWater); Assert.AreEqual(true, exportableWaveConditions.UseForeshore); - Assert.AreEqual(CoverType.GrassWaveRunUp, exportableWaveConditions.CoverType); + Assert.AreEqual(coverType, exportableWaveConditions.CoverType); Assert.AreEqual("Iv", exportableWaveConditions.CategoryBoundaryName); Assert.AreEqual(2, exportableWaveConditions.WaterLevel.NumberOfDecimalPlaces); Assert.AreEqual(2, exportableWaveConditions.WaveHeight.NumberOfDecimalPlaces); @@ -142,7 +160,7 @@ { // Call TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", - null, + (AssessmentSectionCategoryWaveConditionsInput) null, waveConditionsOutputCollection, CoverType.Asphalt);