Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs =================================================================== diff -u -ra979e6ebe32c21456dd9139b3fb07f4a499351c1 -rec27d9f02dc27c2829ed45788fae7d5923d63d3d --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision a979e6ebe32c21456dd9139b3fb07f4a499351c1) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision ec27d9f02dc27c2829ed45788fae7d5923d63d3d) @@ -354,7 +354,7 @@ } [Test] - public void Equal_ToDifferentType_ReturnsFalse() + public void Equals_ToDifferentType_ReturnsFalse() { // Setup DikeProfile dikeProfile = CreateFullyDefinedDikeProfile(); @@ -369,6 +369,20 @@ } [Test] + public void Equals_DerivedClassWithEqualProperties_ReturnsTrue() + { + // Setup + DikeProfile profile = CreateFullyDefinedDikeProfile(); + var derivedLayer = new TestDikeProfile(profile); + + // Call + bool areEqual = profile.Equals(derivedLayer); + + // Assert + Assert.IsTrue(areEqual); + } + + [Test] public void Equals_DifferentWorldReferencePoints_ReturnsFalse() { // Setup @@ -842,5 +856,20 @@ return new DikeProfile(worldCoordinate, dikeGeometry, foreshoreGeometry, breakWater, properties); } + + private class TestDikeProfile : DikeProfile + { + public TestDikeProfile(DikeProfile profile) + : base(profile.WorldReferencePoint, profile.DikeGeometry, profile.ForeshoreGeometry, profile.BreakWater, + new ConstructionProperties + { + Name = profile.Name, + DikeHeight = profile.DikeHeight, + Id = profile.Id, + Orientation = profile.Orientation, + X0 = profile.X0 + }) + { } + } } } \ No newline at end of file