Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs =================================================================== diff -u -r677ec9937ae7eff73a09bf937804ad22e0dc5a4b -r11770f197071c45397a34ec91fc3981acf05c850 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision 677ec9937ae7eff73a09bf937804ad22e0dc5a4b) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision 11770f197071c45397a34ec91fc3981acf05c850) @@ -230,12 +230,12 @@ } [Test] - public void ToString_WithNullName_ReturnsStringEmpty() + public void ToString_WithProfile_ReturnsToStringResultOfProfile() { // Setup var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) { - SoilProfile = new PipingSoilProfile(null, 0.0, new[] + SoilProfile = new PipingSoilProfile("randomName", 0.0, new[] { new PipingSoilLayer(0.0) }, SoilProfileType.SoilProfile1D, 0) @@ -245,30 +245,10 @@ string text = stochasticSoilProfile.ToString(); // Assert - Assert.IsEmpty(text); + Assert.AreEqual(stochasticSoilProfile.SoilProfile.ToString(), text); } - [Test] - [TestCase("")] - [TestCase("some name")] - public void ToString_WithName_ReturnsName(string name) - { - // Setup - var stochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0) - { - SoilProfile = new PipingSoilProfile(name, 0.0, new[] - { - new PipingSoilLayer(0.0) - }, SoilProfileType.SoilProfile1D, 0) - }; - // Call - string text = stochasticSoilProfile.ToString(); - - // Assert - Assert.AreEqual(name, text); - } - private class TestStochasticSoilProfile : StochasticSoilProfile { public TestStochasticSoilProfile(StochasticSoilProfile profile) @@ -312,6 +292,7 @@ StochasticSoilProfile profileA = CreateRandomStochasticProfile(21); StochasticSoilProfile profileB = CreateRandomStochasticProfile(21); StochasticSoilProfile profileC = CreateRandomStochasticProfile(73); + StochasticSoilProfile profileD = CreateRandomStochasticProfile(21); var profileE = new StochasticSoilProfile(0.5, SoilProfileType.SoilProfile1D, 25); var profileF = new StochasticSoilProfile(0.5, SoilProfileType.SoilProfile1D, 45); @@ -321,10 +302,22 @@ { TestName = "Equals_ProfileAProfileB_True" }, + new TestCaseData(profileB, profileD, true) + { + TestName = "Equals_ProfileBProfileD_True" + }, + new TestCaseData(profileA, profileD, true) + { + TestName = "Equals_ProfileAProfileD_True" + }, new TestCaseData(profileB, profileC, false) { TestName = "Equals_ProfileBProfileC_False" }, + new TestCaseData(profileA, profileC, false) + { + TestName = "Equals_ProfileAProfileC_False" + }, new TestCaseData(profileE, profileF, true) { TestName = "Equals_DifferentIds_True"