1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-22 19:28:48 +00:00

Cast sbyte values

Rename test file to SByteTests.cs
This commit is contained in:
Oliver Booth 2022-05-07 23:12:28 +01:00
parent 3434840c39
commit 0e726e9cd8
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -12,12 +12,12 @@ public class SByteTests
{
sbyte Cast(int i) => (sbyte)i;
Assert.AreEqual(0, Enumerable.Range(0, 10).Product());
Assert.AreEqual(1, Enumerable.Range(1, 1).Product());
Assert.AreEqual(2, Enumerable.Range(1, 2).Product());
Assert.AreEqual(6, Enumerable.Range(1, 3).Product());
Assert.AreEqual(24, Enumerable.Range(1, 4).Product());
Assert.AreEqual(120, Enumerable.Range(1, 5).Product());
Assert.AreEqual(0, Enumerable.Range(0, 10).Select(Cast).Product());
Assert.AreEqual(1, Enumerable.Range(1, 1).Select(Cast).Product());
Assert.AreEqual(2, Enumerable.Range(1, 2).Select(Cast).Product());
Assert.AreEqual(6, Enumerable.Range(1, 3).Select(Cast).Product());
Assert.AreEqual(24, Enumerable.Range(1, 4).Select(Cast).Product());
Assert.AreEqual(120, Enumerable.Range(1, 5).Select(Cast).Product());
// 6! will overflow for sbyte
}