Skip to content

Commit

Permalink
Merge pull request nunit#4888 from Saurav-shres/use-first-instead-of-…
Browse files Browse the repository at this point in the history
…toarray

Refactor TestAssert: Replace ToArray()[0] with First() for efficiency.
  • Loading branch information
stevenaw authored Nov 23, 2024
2 parents 573ec3c + 90502f1 commit 6e14a0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NUnitFramework/tests/TestUtilities/TestAssert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void IsRunnable(Type type, string name, ResultState resultState)
object testObject = Reflect.Construct(type);
ITestResult result = TestBuilder.RunTest(test, testObject);
if (result.HasChildren) // In case it's a parameterized method
result = result.Children.ToArray()[0];
result = result.Children.First();
Assert.That(result.ResultState, Is.EqualTo(resultState));
}
#endregion
Expand Down

0 comments on commit 6e14a0f

Please sign in to comment.