Ejemplo n.º 1
0
 public void TestUnknownTypeTruthiness()
 {
     // types unknown to Truthiness.cs are
     // considered to be truthy at all times
     // (unless null)
     Assert.IsTrue(Truthiness.IsTruthy(DateTime.Now));
     Assert.IsTrue(Truthiness.IsTruthy(Encoding.UTF8));
     Assert.IsTrue(Truthiness.IsTruthy(System.Threading.Thread.CurrentThread));
 }
Ejemplo n.º 2
0
 public void TestCharTruthiness()
 {
     Assert.IsTrue(Truthiness.IsTruthy('A'));
     Assert.IsFalse(Truthiness.IsTruthy('\0'));
 }
Ejemplo n.º 3
0
 public void TestDecimalTruthiness()
 {
     Assert.IsTrue(Truthiness.IsTruthy(1M));
     Assert.IsTrue(Truthiness.IsTruthy(-1M));
     Assert.IsFalse(Truthiness.IsTruthy(0M));
 }
Ejemplo n.º 4
0
 public void TestStringTruthiness(bool expected, string value)
 {
     Assert.AreEqual(expected, Truthiness.IsTruthy(value));
 }
Ejemplo n.º 5
0
 public void TestNullTruthiness()
 {
     Assert.IsFalse(Truthiness.IsTruthy <object>(null));
     Assert.IsFalse(Truthiness.IsTruthy((int?)null));
     Assert.IsFalse(Truthiness.IsTruthy(DBNull.Value));
 }
 public void ShowInfo()
 {
     Console.WriteLine($"Bloom info: words {_wordsCount}, filled {Truthiness.ToString("0.####")}");
 }