Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile1DTest.cs =================================================================== diff -u -r4d2b702d8a5e4570ee53fa499f8f5fa196acdb98 -r0321f85aefaf574d1c4005329a5034c1b34ba4d2 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile1DTest.cs (.../SoilProfile1DTest.cs) (revision 4d2b702d8a5e4570ee53fa499f8f5fa196acdb98) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile1DTest.cs (.../SoilProfile1DTest.cs) (revision 0321f85aefaf574d1c4005329a5034c1b34ba4d2) @@ -46,6 +46,43 @@ } [Test] + public void Constructor_LayersNull_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new SoilProfile1D(1, "name", 1, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("layers", exception.ParamName); + } + + [Test] + public void Constructor_NoLayers_ThrowsArgumentException() + { + // Call + TestDelegate test = () => new SoilProfile1D(1, "name", 1, new SoilLayer1D[0]); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("Geen lagen gevonden voor de ondergrondschematisatie.", exception.Message); + } + + [Test] + public void Constructor_BottomAboveLayers_ThrowsArgumentException() + { + // Call + TestDelegate test = () => new SoilProfile1D(1, "name", 9999, new[] + { + new SoilLayer1D(2) + }); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("Eén of meerdere lagen hebben een top onder de bodem van de ondergrondschematisatie.", + exception.Message); + } + + [Test] public void Constructor_ValidArguments_ReturnsExpectedProperties() { // Setup