Add tests for AsArray/AsEnumerable

This commit is contained in:
Oliver Booth 2022-04-22 09:42:58 +01:00
parent 47f1489cbb
commit ae24d94da2
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Core;
using X10D.Text;
namespace X10D.Tests.Core;
[TestClass]
public class CoreTests
{
[TestMethod]
public void AsArrayShouldBeLength1()
{
Assert.AreEqual(1, 0.AsArray().Length);
Assert.AreEqual(1, string.Empty.AsArray().Length);
Assert.AreEqual(1, true.AsArray().Length);
Assert.AreEqual(1, ((object?)null).AsArray().Length);
}
[TestMethod]
public void AsEnumerableShouldBeLength1()
{
Assert.AreEqual(1, 0.AsEnumerable().Count());
Assert.AreEqual(1, string.Empty.AsEnumerable().Count());
Assert.AreEqual(1, true.AsEnumerable().Count());
Assert.AreEqual(1, ((object?)null).AsEnumerable().Count());
}
}