namespace X10D.Tests { using Microsoft.VisualStudio.TestTools.UnitTesting; /// /// Tests for . /// [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 . /// [TestMethod] public void ToInt32() { const bool a = true; const bool b = false; Assert.IsTrue(a); Assert.IsFalse(b); Assert.AreEqual(1, a.ToInt32()); Assert.AreEqual(0, b.ToInt32()); } /// /// Tests for . /// [TestMethod] public void ToInt64() { const bool a = true; const bool b = false; Assert.IsTrue(a); Assert.IsFalse(b); Assert.AreEqual(1L, a.ToInt64()); Assert.AreEqual(0L, b.ToInt64()); } /// /// Tests for . /// [TestMethod] public void Not() { const bool a = true; const bool b = false; Assert.IsTrue(a); Assert.IsFalse(b); Assert.IsFalse(a.Not()); Assert.IsTrue(b.Not()); } /// /// Tests for . /// [TestMethod] public void And() { const bool a = true; const bool b = true; const bool c = false; const bool d = false; Assert.IsTrue(a); Assert.IsTrue(b); Assert.IsFalse(c); Assert.IsFalse(d); Assert.IsTrue(a.And(b)); Assert.IsFalse(b.And(c)); Assert.IsFalse(c.And(d)); } /// /// Tests for . /// [TestMethod] public void Or() { const bool a = true; const bool b = true; const bool c = false; const bool d = false; Assert.IsTrue(a); Assert.IsTrue(b); Assert.IsFalse(c); Assert.IsFalse(d); Assert.IsTrue(a.Or(b)); Assert.IsTrue(b.Or(c)); Assert.IsFalse(c.Or(d)); } /// /// Tests for . /// [TestMethod] public void XOr() { const bool a = true; const bool b = true; const bool c = false; const bool d = false; Assert.IsTrue(a); Assert.IsTrue(b); Assert.IsFalse(c); Assert.IsFalse(d); Assert.IsFalse(a.XOr(b)); Assert.IsTrue(b.XOr(c)); Assert.IsFalse(c.XOr(d)); } /// /// Tests for . /// [TestMethod] public void NAnd() { const bool a = true; const bool b = true; const bool c = false; const bool d = false; Assert.IsTrue(a); Assert.IsTrue(b); Assert.IsFalse(c); Assert.IsFalse(d); Assert.IsFalse(a.NAnd(b)); Assert.IsTrue(b.NAnd(c)); Assert.IsTrue(c.NAnd(d)); } /// /// Tests for . /// [TestMethod] public void NOr() { const bool a = true; const bool b = true; const bool c = false; const bool d = false; Assert.IsTrue(a); Assert.IsTrue(b); Assert.IsFalse(c); Assert.IsFalse(d); Assert.IsFalse(a.NOr(b)); Assert.IsFalse(b.NOr(c)); Assert.IsTrue(c.NOr(d)); } /// /// Tests for . /// [TestMethod] public void XNOr() { const bool a = true; const bool b = true; const bool c = false; const bool d = false; Assert.IsTrue(a); Assert.IsTrue(b); Assert.IsFalse(c); Assert.IsFalse(d); Assert.IsTrue(a.XNOr(b)); Assert.IsFalse(b.XNOr(c)); Assert.IsTrue(c.XNOr(d)); } } }