Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ring.cs =================================================================== diff -u -r33a3c76cadc26935657a67c5b0d3e19733d84860 -rc2b77b22666a09fdc2348440c76cd37325aeba7d --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ring.cs (.../Ring.cs) (revision 33a3c76cadc26935657a67c5b0d3e19733d84860) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Ring.cs (.../Ring.cs) (revision c2b77b22666a09fdc2348440c76cd37325aeba7d) @@ -58,14 +58,17 @@ { return false; } + if (ReferenceEquals(this, obj)) { return true; } + if (obj.GetType() != GetType()) { return false; } + return Equals((Ring) obj); } @@ -78,6 +81,7 @@ { hashCode = (hashCode * 397) ^ p.GetHashCode(); } + return hashCode; } } @@ -99,6 +103,7 @@ { throw new ArgumentNullException(nameof(points)); } + if (points.Distinct().Count() < 2) { throw new ArgumentException($@"Need at least two distinct points to define a {typeof(Ring).Name}.", nameof(points));