Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil.Test/ClosingStructurePermutationHelperTest.cs =================================================================== diff -u -r61c2ac2573d82151b0b1593260a419543d07122a -r6949918830314633db5cc8c16bb2188779fffc93 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil.Test/ClosingStructurePermutationHelperTest.cs (.../ClosingStructurePermutationHelperTest.cs) (revision 61c2ac2573d82151b0b1593260a419543d07122a) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.TestUtil.Test/ClosingStructurePermutationHelperTest.cs (.../ClosingStructurePermutationHelperTest.cs) (revision 6949918830314633db5cc8c16bb2188779fffc93) @@ -36,12 +36,12 @@ const string testResultDescription = "B"; // Call - List testCaseDatas = ClosingStructurePermutationHelper.DifferentClosingStructures(targetName, testResultDescription).ToList(); + IEnumerable testCaseData = ClosingStructurePermutationHelper.DifferentClosingStructures(targetName, testResultDescription); // Assert - Assert.AreEqual(27, testCaseDatas.Count); - AssertTestNames(testCaseDatas, targetName, testResultDescription); - AssertParameters(testCaseDatas, true, true, true); + Assert.AreEqual(27, testCaseData.Count()); + AssertTestNames(testCaseData, targetName, testResultDescription); + AssertParameters(testCaseData, true, true, true); } [Test] @@ -52,12 +52,12 @@ const string testResultDescription = "D"; // Call - List testCaseDatas = ClosingStructurePermutationHelper.DifferentClosingStructuresWithSameId(targetName, testResultDescription).ToList(); + IEnumerable testCaseData = ClosingStructurePermutationHelper.DifferentClosingStructuresWithSameId(targetName, testResultDescription); // Assert - Assert.AreEqual(26, testCaseDatas.Count); - AssertTestNames(testCaseDatas, targetName, testResultDescription); - AssertParameters(testCaseDatas, false, true, true); + Assert.AreEqual(26, testCaseData.Count()); + AssertTestNames(testCaseData, targetName, testResultDescription); + AssertParameters(testCaseData, false, true, true); } [Test] @@ -68,35 +68,35 @@ const string testResultDescription = "F"; // Call - List testCaseDatas = ClosingStructurePermutationHelper.DifferentClosingStructuresWithSameIdNameAndLocation(targetName, testResultDescription).ToList(); + IEnumerable testCaseData = ClosingStructurePermutationHelper.DifferentClosingStructuresWithSameIdNameAndLocation(targetName, testResultDescription); // Assert - Assert.AreEqual(24, testCaseDatas.Count); - AssertTestNames(testCaseDatas, targetName, testResultDescription); - AssertParameters(testCaseDatas, false, false, false); + Assert.AreEqual(24, testCaseData.Count()); + AssertTestNames(testCaseData, targetName, testResultDescription); + AssertParameters(testCaseData, false, false, false); } - private static void AssertTestNames(IEnumerable testCaseDatas, string targetName, string testResultDescription) + private static void AssertTestNames(IEnumerable testCaseData, string targetName, string testResultDescription) { - IEnumerable testNames = testCaseDatas + IEnumerable testNames = testCaseData .Select(tcd => tcd.TestName) - .ToList(); - Assert.AreEqual(testCaseDatas.Count(), testNames.Distinct().Count()); + .ToArray(); + Assert.AreEqual(testCaseData.Count(), testNames.Distinct().Count()); Assert.IsTrue(testNames.All(tn => tn.StartsWith($"{targetName}_"))); Assert.IsTrue(testNames.All(tn => tn.EndsWith($"_{testResultDescription}"))); } - private static void AssertParameters(IEnumerable testCaseDatas, bool idUnique, bool nameUnique, bool locationUnique) + private static void AssertParameters(IEnumerable testCaseData, bool idUnique, bool nameUnique, bool locationUnique) { var differentStructures = new List(); var referenceStructure = new TestClosingStructure(); - IEnumerable structures = testCaseDatas + IEnumerable structures = testCaseData .Select(tcd => tcd.Arguments[0]) .OfType() - .ToList(); + .ToArray(); - int expectedTestDataCount = testCaseDatas.Count(); + int expectedTestDataCount = testCaseData.Count(); Assert.AreEqual(expectedTestDataCount, structures.Count()); if (idUnique)