From bf779bafec206356560bcf203d70bc51bba13733 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sat, 18 Apr 2020 23:39:04 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Add=20ToInt16=20and=20ToInt64=20in?= =?UTF-8?q?=20BooleanTests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- X10D.Tests/src/BooleanTests.cs | 42 +++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/X10D.Tests/src/BooleanTests.cs b/X10D.Tests/src/BooleanTests.cs index 47b5b38..f571dca 100644 --- a/X10D.Tests/src/BooleanTests.cs +++ b/X10D.Tests/src/BooleanTests.cs @@ -8,6 +8,38 @@ namespace X10D.Tests [TestClass] public class BooleanTests { + /// + /// Tests for . + /// + [TestMethod] + public void ToByte() + { + const bool a = true; + const bool b = false; + const byte c = 1; + const byte d = 0; + + Assert.IsTrue(a); + Assert.IsFalse(b); + Assert.AreEqual(c, a.ToByte()); + Assert.AreEqual(d, b.ToByte()); + } + + /// + /// Tests for . + /// + [TestMethod] + public void ToInt16() + { + const bool a = true; + const bool b = false; + + Assert.IsTrue(a); + Assert.IsFalse(b); + Assert.AreEqual(1, a.ToInt16()); + Assert.AreEqual(0, b.ToInt16()); + } + /// /// Tests for . /// @@ -24,20 +56,18 @@ namespace X10D.Tests } /// - /// Tests for . + /// Tests for . /// [TestMethod] - public void ToByte() + public void ToInt64() { const bool a = true; const bool b = false; - const byte c = 1; - const byte d = 0; Assert.IsTrue(a); Assert.IsFalse(b); - Assert.AreEqual(c, a.ToByte()); - Assert.AreEqual(d, b.ToByte()); + Assert.AreEqual(1L, a.ToInt64()); + Assert.AreEqual(0L, b.ToInt64()); } ///