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)); }
public void TestCharTruthiness() { Assert.IsTrue(Truthiness.IsTruthy('A')); Assert.IsFalse(Truthiness.IsTruthy('\0')); }
public void TestDecimalTruthiness() { Assert.IsTrue(Truthiness.IsTruthy(1M)); Assert.IsTrue(Truthiness.IsTruthy(-1M)); Assert.IsFalse(Truthiness.IsTruthy(0M)); }
public void TestStringTruthiness(bool expected, string value) { Assert.AreEqual(expected, Truthiness.IsTruthy(value)); }
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.####")}"); }