Example #1
0
        public void TryParseBoolTest()
        {
            Assert.IsTrue(Bool.TryParse("1", out Bool @bool));
            Assert.IsTrue(@bool);
            Assert.IsTrue(Bool.TryParse("1".GetBytes(), out @bool));
            Assert.IsTrue(@bool);

            Assert.IsTrue(Bool.TryParse("0", out @bool));
            Assert.IsFalse(@bool);
            Assert.IsTrue(Bool.TryParse("0", out @bool));
            Assert.IsFalse(@bool);

            Assert.IsFalse(Bool.TryParse("2", out @bool));
            Assert.AreEqual(default, @bool);