mirror of https://github.com/oliverbooth/X10D
Add tests for AsArray/AsEnumerable
This commit is contained in:
parent
47f1489cbb
commit
ae24d94da2
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue