Index: Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/PipingSoilProfileTest.cs =================================================================== diff -u -r669e99259a7cc575b5df2be2c0ea7105d9edcbcf -rec27d9f02dc27c2829ed45788fae7d5923d63d3d --- Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/PipingSoilProfileTest.cs (.../PipingSoilProfileTest.cs) (revision 669e99259a7cc575b5df2be2c0ea7105d9edcbcf) +++ Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/PipingSoilProfileTest.cs (.../PipingSoilProfileTest.cs) (revision ec27d9f02dc27c2829ed45788fae7d5923d63d3d) @@ -221,6 +221,20 @@ } [Test] + public void Equals_DerivedClassWithEqualProperties_ReturnsTrue() + { + // Setup + PipingSoilProfile profile = CreateRandomProfile(2); + var derivedProfile = new TestProfile(profile); + + // Call + bool areEqual = profile.Equals(derivedProfile); + + // Assert + Assert.IsTrue(areEqual); + } + + [Test] public void Equals_Null_ReturnsFalse() { // Setup @@ -356,5 +370,15 @@ { return new string('x', random.Next(0, 40)); } + + private class TestProfile : PipingSoilProfile + { + public TestProfile(PipingSoilProfile profile) + : base(profile.Name, + profile.Bottom, + profile.Layers, + profile.SoilProfileType, + profile.PipingSoilProfileId) {} + } } } \ No newline at end of file