Index: Ringtoets/Piping/src/Ringtoets.Piping.Primitives/PipingSoilProfile.cs =================================================================== diff -u -rd67d84b0725d8e7192f1b8e2649eab0a5b1dcb69 -rc5c520903649e40b5a48611051705c07c95672e9 --- Ringtoets/Piping/src/Ringtoets.Piping.Primitives/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision d67d84b0725d8e7192f1b8e2649eab0a5b1dcb69) +++ Ringtoets/Piping/src/Ringtoets.Piping.Primitives/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision c5c520903649e40b5a48611051705c07c95672e9) @@ -110,8 +110,10 @@ { return layer.Top - previousLevel; } + previousLevel = oLayer.Top; } + throw new ArgumentException("Layer not found in profile."); } @@ -126,14 +128,17 @@ { return false; } + if (ReferenceEquals(this, obj)) { return true; } + if (GetType() != obj.GetType()) { return false; } + return Equals((PipingSoilProfile) obj); } @@ -174,10 +179,12 @@ { throw new ArgumentNullException(nameof(collection), string.Format(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers)); } + if (!collection.Any()) { throw new ArgumentException(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers); } + if (collection.Any(l => l.Top < Bottom)) { throw new ArgumentException(Resources.PipingSoilProfile_Layers_Layer_top_below_profile_bottom);