Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/SoilProfile2DReaderTest.cs =================================================================== diff -u -r751aaf9b7623bac357cbacf4e6ddae87b2b69f1f -rcb6877f670bacc7a6a896ab132d592eeef1107b5 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/SoilProfile2DReaderTest.cs (.../SoilProfile2DReaderTest.cs) (revision 751aaf9b7623bac357cbacf4e6ddae87b2b69f1f) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfile/SoilProfile2DReaderTest.cs (.../SoilProfile2DReaderTest.cs) (revision cb6877f670bacc7a6a896ab132d592eeef1107b5) @@ -138,7 +138,7 @@ const string path = "A"; reader.Expect(r => r.Path).Return(path); - SetExpectations(0, name, 0.0, 1.0, 0.0, 0.0, 0.0, new byte[0], string.Empty, 0); + SetExpectations(0, name, 0.0, 1.0, string.Empty, 0, new byte[0], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); mocks.ReplayAll(); @@ -161,7 +161,7 @@ const string path = "A"; reader.Expect(r => r.Path).Return(path); - SetExpectations(1, name, 0.0, 1.0, 0.0, 0.0, 0.0, null, string.Empty, 0); + SetExpectations(1, name, 0.0, 1.0, string.Empty, 0, null, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); mocks.ReplayAll(); @@ -183,7 +183,7 @@ const string name = "cool name"; const string path = "A"; - SetExpectations(1, name, 0.0, 1.0, 0.0, 0.0, 0.0, new byte[0], string.Empty, 0); + SetExpectations(1, name, 0.0, 1.0, string.Empty, 0, new byte[0], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); reader.Expect(r => r.Path).Return(path); mocks.ReplayAll(); @@ -227,7 +227,7 @@ public void ReadFrom_NullValuesForLayer_ReturnsProfileWithNullValuesAndDefaultsOnLayer() { // Setup - SetExpectations(1, "", 0.0, null, null, null, null, someGeometry, null, null); + SetExpectations(1, "", 0.0, null, null, null, someGeometry, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0); mocks.ReplayAll(); @@ -241,9 +241,6 @@ var pipingSoilLayer = profile.Layers.First(); Assert.AreEqual(1.1, pipingSoilLayer.Top); - Assert.IsNull(pipingSoilLayer.BelowPhreaticLevel); - Assert.IsNull(pipingSoilLayer.AbovePhreaticLevel); - Assert.IsNull(pipingSoilLayer.DryUnitWeight); Assert.IsFalse(pipingSoilLayer.IsAquifer); Assert.IsEmpty(pipingSoilLayer.MaterialName); Assert.AreEqual(Color.Empty, pipingSoilLayer.Color); @@ -259,15 +256,36 @@ { // Setup var random = new Random(22); - var belowPhreaticLevel = random.NextDouble(); var abovePhreaticLevel = random.NextDouble(); var dryUnitWeight = random.NextDouble(); var intersectionX = 0.5; var materialName = "material"; var color = Color.FromArgb(Color.AliceBlue.ToArgb()); - SetExpectations(layerCount, "", intersectionX, 1.0, belowPhreaticLevel, abovePhreaticLevel, dryUnitWeight, someGeometry, materialName, color.ToArgb()); + var belowPhreaticLevelMean = random.NextDouble(); + var belowPhreaticLevelDeviation = random.NextDouble(); + var diameterD70Mean = random.NextDouble(); + var diameterD70Deviation = random.NextDouble(); + var permeabilityMean = random.NextDouble(); + var permeabilityDeviation = random.NextDouble(); + SetExpectations( + layerCount, + "", + intersectionX, + 1.0, + materialName, + color.ToArgb(), + someGeometry, + abovePhreaticLevel, + dryUnitWeight, + belowPhreaticLevelMean, + belowPhreaticLevelDeviation, + diameterD70Mean, + diameterD70Deviation, + permeabilityMean, + permeabilityDeviation); + mocks.ReplayAll(); // Call @@ -280,29 +298,49 @@ var pipingSoilLayer = profile.Layers.First(); Assert.AreEqual(1.1, pipingSoilLayer.Top); - Assert.AreEqual(belowPhreaticLevel, pipingSoilLayer.BelowPhreaticLevel); Assert.AreEqual(abovePhreaticLevel, pipingSoilLayer.AbovePhreaticLevel); Assert.AreEqual(dryUnitWeight, pipingSoilLayer.DryUnitWeight); Assert.IsTrue(pipingSoilLayer.IsAquifer); Assert.AreEqual(materialName, pipingSoilLayer.MaterialName); Assert.AreEqual(color, pipingSoilLayer.Color); + + Assert.AreEqual(belowPhreaticLevelMean, pipingSoilLayer.BelowPhreaticLevelMean); + Assert.AreEqual(belowPhreaticLevelDeviation, pipingSoilLayer.BelowPhreaticLevelDeviation); + Assert.AreEqual(diameterD70Mean, pipingSoilLayer.DiameterD70Mean); + Assert.AreEqual(diameterD70Deviation, pipingSoilLayer.DiameterD70Deviation); + Assert.AreEqual(permeabilityMean, pipingSoilLayer.PermeabilityMean); + Assert.AreEqual(permeabilityDeviation, pipingSoilLayer.PermeabilityDeviation); + mocks.VerifyAll(); } - private void SetExpectations(int layerCount, string profileName, double intersectionX, double? isAquifer, double? belowPhreaticLevel, double? abovePhreaticLevel, double? dryUnitWeight, byte[] geometry, string materialName, double? color) + private void SetExpectations(int layerCount, string profileName, double intersectionX, double? isAquifer, string materialName, double? color, byte[] geometry, double abovePhreaticLevel, double dryUnitWeight, double belowPhreaticLevelMean, double belowPhreaticLevelDeviation, double diameterD70Mean, double diameterD70Deviation, double permeabilityMean, double permeabilityDeviation) { reader.Expect(r => r.Read(SoilProfileDatabaseColumns.LayerCount)).Return(layerCount).Repeat.Any(); reader.Expect(r => r.Read(SoilProfileDatabaseColumns.ProfileName)).Return(profileName).Repeat.Any(); reader.Expect(r => r.Read(SoilProfileDatabaseColumns.IntersectionX)).Return(intersectionX).Repeat.Any(); + reader.Expect(r => r.Read(SoilProfileDatabaseColumns.LayerGeometry)).Return(geometry).Repeat.Any(); reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.IsAquifer)).Return(isAquifer).Repeat.Any(); - reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.AbovePhreaticLevel)).Return(abovePhreaticLevel).Repeat.Any(); - reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DryUnitWeight)).Return(dryUnitWeight).Repeat.Any(); - reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.BelowPhreaticLevelMean)).Return(belowPhreaticLevel).Repeat.Any(); - reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DiameterD70Mean)).Return(abovePhreaticLevel).Repeat.Any(); - reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.PermeabilityMean)).Return(dryUnitWeight).Repeat.Any(); reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.MaterialName)).Return(materialName).Repeat.Any(); reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.Color)).Return(color).Repeat.Any(); - reader.Expect(r => r.Read(SoilProfileDatabaseColumns.LayerGeometry)).Return(geometry).Repeat.Any(); + + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.AbovePhreaticLevel)).Return(abovePhreaticLevel).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DryUnitWeight)).Return(dryUnitWeight).Repeat.Any(); + + var logNormalDistribution = 3; + var logNormalShift = 0; + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.BelowPhreaticLevelDistribution)).Return(logNormalDistribution).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.BelowPhreaticLevelShift)).Return(logNormalShift).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.BelowPhreaticLevelMean)).Return(belowPhreaticLevelMean).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.BelowPhreaticLevelDeviation)).Return(belowPhreaticLevelDeviation).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DiameterD70Distribution)).Return(logNormalDistribution).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DiameterD70Shift)).Return(logNormalShift).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DiameterD70Mean)).Return(diameterD70Mean).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.DiameterD70Deviation)).Return(diameterD70Deviation).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.PermeabilityDistribution)).Return(logNormalDistribution).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.PermeabilityShift)).Return(logNormalShift).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.PermeabilityMean)).Return(permeabilityMean).Repeat.Any(); + reader.Expect(r => r.ReadOrDefault(SoilProfileDatabaseColumns.PermeabilityDeviation)).Return(permeabilityDeviation).Repeat.Any(); } private static string GetExpectedSoilProfileReaderErrorMessage(string path, string name, string errorMessage)