Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditions/ExportableWaveConditionsFactoryTest.cs =================================================================== diff -u -r29e5f1ed0694c7bad1d044b4e1dfd8b1c8415cb8 -rfaee3de18c59589d2380809cccd379c5c8aa76ce --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditions/ExportableWaveConditionsFactoryTest.cs (.../ExportableWaveConditionsFactoryTest.cs) (revision 29e5f1ed0694c7bad1d044b4e1dfd8b1c8415cb8) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditions/ExportableWaveConditionsFactoryTest.cs (.../ExportableWaveConditionsFactoryTest.cs) (revision faee3de18c59589d2380809cccd379c5c8aa76ce) @@ -249,5 +249,101 @@ Assert.AreEqual(waveConditionsOutput.WaveAngle, exportableWaveConditions.WaveAngle); Assert.AreEqual(waveConditionsOutput.WaveDirection, exportableWaveConditions.WaveDirection); } + + [Test] + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_NameNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(null, + new FailureMechanismCategoryWaveConditionsInput(), + waveConditionsOutputCollection, + CoverType.Asphalt); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("name", exception.ParamName); + } + + [Test] + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_WaveConditionsInputNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", + null, + waveConditionsOutputCollection, + CoverType.Asphalt); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("waveConditionsInput", exception.ParamName); + } + + [Test] + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_OutputNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", + new FailureMechanismCategoryWaveConditionsInput(), + null, + CoverType.Asphalt); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("output", exception.ParamName); + } + + [Test] + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_CoverTypeNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("aName", + new FailureMechanismCategoryWaveConditionsInput(), + Enumerable.Empty(), + (CoverType) null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("coverType", exception.ParamName); + } + + [Test] + public void CreateExportableWaveConditionsCollectionWithFailureMechanismCategoryWaveConditionsInput_ValidDataWithCoverType_ReturnsValidCollection() + { + // Setup + var waveConditionsInput = new FailureMechanismCategoryWaveConditionsInput + { + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "hblName", 1.0, 8.0), + ForeshoreProfile = new TestForeshoreProfile(), + UseForeshore = true + }; + + // Call + ExportableWaveConditions[] exportableWaveConditionsCollection = + ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection("ewcName", + waveConditionsInput, + waveConditionsOutputCollection, + CoverType.Grass).ToArray(); + + // Assert + Assert.AreEqual(1, exportableWaveConditionsCollection.Length); + ExportableWaveConditions exportableWaveConditions = exportableWaveConditionsCollection[0]; + Assert.AreEqual("ewcName", exportableWaveConditions.CalculationName); + Assert.AreEqual("hblName", exportableWaveConditions.LocationName); + Assert.AreEqual(1.0, exportableWaveConditions.LocationXCoordinate); + Assert.AreEqual(8.0, exportableWaveConditions.LocationYCoordinate); + Assert.AreEqual("id", exportableWaveConditions.ForeshoreId); + Assert.AreEqual(false, exportableWaveConditions.UseBreakWater); + Assert.AreEqual(true, exportableWaveConditions.UseForeshore); + Assert.AreEqual(CoverType.Grass, exportableWaveConditions.CoverType); + Assert.AreEqual(2, exportableWaveConditions.WaterLevel.NumberOfDecimalPlaces); + Assert.AreEqual(2, exportableWaveConditions.WaveHeight.NumberOfDecimalPlaces); + Assert.AreEqual(2, exportableWaveConditions.WavePeriod.NumberOfDecimalPlaces); + Assert.AreEqual(2, exportableWaveConditions.WaveAngle.NumberOfDecimalPlaces); + Assert.AreEqual(waveConditionsOutput.WaterLevel, exportableWaveConditions.WaterLevel); + Assert.AreEqual(waveConditionsOutput.WaveHeight, exportableWaveConditions.WaveHeight); + Assert.AreEqual(waveConditionsOutput.WavePeakPeriod, exportableWaveConditions.WavePeriod); + Assert.AreEqual(waveConditionsOutput.WaveAngle, exportableWaveConditions.WaveAngle); + Assert.AreEqual(waveConditionsOutput.WaveDirection, exportableWaveConditions.WaveDirection); + } } } \ No newline at end of file