Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs =================================================================== diff -u -r5edeb0ef7899f4554c0c06d0e3f3b8269666e65e -rd502e52f215cfeb0b08dcc3289e5fbf1a6bce625 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 5edeb0ef7899f4554c0c06d0e3f3b8269666e65e) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision d502e52f215cfeb0b08dcc3289e5fbf1a6bce625) @@ -202,26 +202,14 @@ private static IEnumerable GetUnequalTestCases() { - StructureBase.ConstructionProperties differentId = CreateFullyConfiguredConstructionProperties(); - differentId.Id = "differentId"; - yield return new TestCaseData(new TestStructureBase(differentId)) - .SetName(nameof(differentId)); + foreach (ChangePropertyData changeSingleDataProperty in ChangeSingleDataProperties()) + { + StructureBase.ConstructionProperties differentConstructionProperties = CreateFullyConfiguredConstructionProperties(); + changeSingleDataProperty.ActionToChangeProperty(differentConstructionProperties); + yield return new TestCaseData(new TestStructureBase(differentConstructionProperties)) + .SetName(changeSingleDataProperty.PropertyName); + } - StructureBase.ConstructionProperties differentName = CreateFullyConfiguredConstructionProperties(); - differentName.Name = "differentName"; - yield return new TestCaseData(new TestStructureBase(differentName)) - .SetName(nameof(differentName)); - - StructureBase.ConstructionProperties differentLocation = CreateFullyConfiguredConstructionProperties(); - differentLocation.Location = new Point2D(9, 9); - yield return new TestCaseData(new TestStructureBase(differentLocation)) - .SetName(nameof(differentLocation)); - - StructureBase.ConstructionProperties differentOrientation = CreateFullyConfiguredConstructionProperties(); - differentOrientation.StructureNormalOrientation = (RoundedDouble) 90; - yield return new TestCaseData(new TestStructureBase(differentOrientation)) - .SetName(nameof(differentOrientation)); - yield return new TestCaseData(new OtherTestStructureBase(CreateFullyConfiguredConstructionProperties())) .SetName("Other derived class"); } @@ -233,16 +221,27 @@ private static StructureBase.ConstructionProperties CreateFullyConfiguredConstructionProperties() { - const string id = "structure id"; - const string name = "Structure name"; return new StructureBase.ConstructionProperties { - Id = id, - Name = name, + Id = "structure id", + Name = "Structure name", Location = new Point2D(1, 1), StructureNormalOrientation = (RoundedDouble) 25 }; } + + private static IEnumerable> ChangeSingleDataProperties() + { + var random = new Random(21); + RoundedDouble offset = random.NextRoundedDouble(); + + yield return new ChangePropertyData(cs => cs.Id = "Different Id", "Id"); + yield return new ChangePropertyData(cs => cs.Name = "Different Name", "Name"); + yield return new ChangePropertyData(cs => cs.Location = new Point2D(cs.Location.X + offset, cs.Location.Y), + "Location"); + yield return new ChangePropertyData(cs => cs.StructureNormalOrientation = cs.StructureNormalOrientation + offset, + "Orientation"); + } } private class TestStructureBase : StructureBase