Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile2DReaderTest.cs =================================================================== diff -u -r0d2a68ed9f6d5c10c01a1cb7de3bdcba843d4ab8 -rfb494de3c4b854048e775f41b2905860beedb3b5 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile2DReaderTest.cs (.../SoilProfile2DReaderTest.cs) (revision 0d2a68ed9f6d5c10c01a1cb7de3bdcba843d4ab8) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile2DReaderTest.cs (.../SoilProfile2DReaderTest.cs) (revision fb494de3c4b854048e775f41b2905860beedb3b5) @@ -137,7 +137,7 @@ } [Test] - public void ReadSoilProfile_DatabaseWith2DSoilProfile_ReturnOneProfile() + public void ReadSoilProfile_DatabaseWith2DSoilProfile3Layers_ReturnOneProfile() { // Setup string dbFile = Path.Combine(testDataPath, "2dprofile.soil"); @@ -418,6 +418,80 @@ } [Test] + public void ReadSoilProfile_DatabaseWith1DProfile1LayerWithAllNullValues_ReturnsProfileWithDefaultValues() + { + // Setup + string dbFile = Path.Combine(testDataPath, "2dprofileWithLayerWithNullValuesOnly.soil"); + using (var reader = new SoilProfile2DReader(dbFile)) + { + reader.Initialize(); + + // Call + SoilProfile2D profile = reader.ReadSoilProfile(); + + // Assert + Assert.AreEqual(1, profile.Id); + Assert.AreEqual("Profile", profile.Name); + Assert.AreEqual(85.2, profile.IntersectionX); + + SoilLayer2D soilLayer = profile.Layers.Single(); + Assert.AreEqual("Material1", soilLayer.MaterialName); + Assert.IsFalse(soilLayer.IsAquifer); + Assert.AreEqual(Color.Empty, soilLayer.Color); + + Assert.IsNull(soilLayer.BelowPhreaticLevelDistribution); + Assert.IsNaN(soilLayer.BelowPhreaticLevelMean); + Assert.IsNaN(soilLayer.BelowPhreaticLevelDeviation); + Assert.IsNaN(soilLayer.BelowPhreaticLevelShift); + + Assert.IsNull(soilLayer.DiameterD70Distribution); + Assert.IsNaN(soilLayer.DiameterD70Mean); + Assert.IsNaN(soilLayer.DiameterD70CoefficientOfVariation); + Assert.IsNaN(soilLayer.DiameterD70Shift); + + Assert.IsNull(soilLayer.PermeabilityDistribution); + Assert.IsNaN(soilLayer.PermeabilityMean); + Assert.IsNaN(soilLayer.PermeabilityCoefficientOfVariation); + Assert.IsNaN(soilLayer.PermeabilityShift); + + Assert.IsNull(soilLayer.UsePop); + Assert.IsNull(soilLayer.ShearStrengthModel); + + Assert.IsNull(soilLayer.AbovePhreaticLevelDistribution); + Assert.IsNaN(soilLayer.AbovePhreaticLevelMean); + Assert.IsNaN(soilLayer.AbovePhreaticLevelDeviation); + Assert.IsNaN(soilLayer.AbovePhreaticLevelShift); + + Assert.IsNull(soilLayer.CohesionDistribution); + Assert.IsNaN(soilLayer.CohesionMean); + Assert.IsNaN(soilLayer.CohesionDeviation); + Assert.IsNaN(soilLayer.CohesionShift); + + Assert.IsNull(soilLayer.FrictionAngleDistribution); + Assert.IsNaN(soilLayer.FrictionAngleMean); + Assert.IsNaN(soilLayer.FrictionAngleDeviation); + Assert.IsNaN(soilLayer.FrictionAngleShift); + + Assert.IsNull(soilLayer.ShearStrengthRatioDistribution); + Assert.IsNaN(soilLayer.ShearStrengthRatioMean); + Assert.IsNaN(soilLayer.ShearStrengthRatioDeviation); + Assert.IsNaN(soilLayer.ShearStrengthRatioShift); + + Assert.IsNull(soilLayer.StrengthIncreaseExponentDistribution); + Assert.IsNaN(soilLayer.StrengthIncreaseExponentMean); + Assert.IsNaN(soilLayer.StrengthIncreaseExponentDeviation); + Assert.IsNaN(soilLayer.StrengthIncreaseExponentShift); + + Assert.IsNull(soilLayer.PopDistribution); + Assert.IsNaN(soilLayer.PopMean); + Assert.IsNaN(soilLayer.PopDeviation); + Assert.IsNaN(soilLayer.PopShift); + } + + Assert.IsTrue(TestHelper.CanOpenFileForWrite(dbFile)); + } + + [Test] public void ReadSoilProfile_IntersectionXFor2DSoilProfileInvalid_ThrowsSoilProfileReadException() { // Setup