Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfile1D.cs =================================================================== diff -u -rd67d84b0725d8e7192f1b8e2649eab0a5b1dcb69 -rc2b77b22666a09fdc2348440c76cd37325aeba7d --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfile1D.cs (.../MacroStabilityInwardsSoilProfile1D.cs) (revision d67d84b0725d8e7192f1b8e2649eab0a5b1dcb69) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsSoilProfile1D.cs (.../MacroStabilityInwardsSoilProfile1D.cs) (revision c2b77b22666a09fdc2348440c76cd37325aeba7d) @@ -94,6 +94,7 @@ { throw new ArgumentNullException(nameof(value)); } + name = value; } } @@ -115,8 +116,10 @@ { return layer.Top - previousLevel; } + previousLevel = oLayer.Top; } + throw new ArgumentException("Layer not found in profile."); } @@ -131,14 +134,17 @@ { return false; } + if (ReferenceEquals(this, obj)) { return true; } + if (obj.GetType() != GetType()) { return false; } + return Equals((MacroStabilityInwardsSoilProfile1D) obj); } @@ -174,6 +180,7 @@ return false; } } + return true; } @@ -195,10 +202,12 @@ { throw new ArgumentNullException(nameof(collection), string.Format(Resources.Error_Cannot_Construct_MacroStabilityInwardsSoilProfile_Without_Layers)); } + if (!collection.Any()) { throw new ArgumentException(Resources.Error_Cannot_Construct_MacroStabilityInwardsSoilProfile_Without_Layers); } + if (collection.Any(l => l.Top < Bottom)) { throw new ArgumentException(Resources.MacroStabilityInwardsSoilProfile_Layers_Layer_top_below_profile_bottom);