1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:18:47 +00:00

Fix nullability of AsEnumerable return type

This commit is contained in:
Oliver Booth 2022-04-24 10:29:04 +01:00
parent e2a496face
commit 199b82b9a6
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -5,7 +5,7 @@ using X10D.Core;
namespace X10D.Tests.Core; namespace X10D.Tests.Core;
[TestClass] [TestClass]
public partial class EnumerableTests public class EnumerableTests
{ {
[TestMethod] [TestMethod]
[DataRow(1)] [DataRow(1)]
@ -13,12 +13,12 @@ public partial class EnumerableTests
[DataRow(true)] [DataRow(true)]
public void AsEnumerable(object o) public void AsEnumerable(object o)
{ {
IEnumerable<object> array = o.AsEnumerable().ToArray(); // prevent multiple enumeration of IEnumerable IEnumerable<object?> array = o.AsEnumerable().ToArray(); // prevent multiple enumeration of IEnumerable
Assert.IsNotNull(array); Assert.IsNotNull(array);
Assert.IsTrue(array.Count() == 1); Assert.IsTrue(array.Count() == 1);
Assert.AreEqual(o, array.ElementAt(0)); Assert.AreEqual(o, array.ElementAt(0));
} }
[TestMethod] [TestMethod]
[DataRow(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)] [DataRow(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)]
public void Shuffled(params int[] source) public void Shuffled(params int[] source)