public void Equals6() { DateComparer comparer = DateComparer.DefaultInvariant as DateComparer; string x = "10/31/2006"; string y = "11/1/2006"; Assert.IsFalse(comparer.Equals(x, y)); Assert.IsTrue(comparer.Equals(x, x)); }
public void Equals4() { DateComparer comparer = DateComparer.DefaultInvariant as DateComparer; DateTime x = DateTime.Today; DateTime y = DateTime.Today.AddDays(1); Assert.IsFalse(comparer.Equals(x, y)); Assert.IsTrue(comparer.Equals(x, x)); }
public void Equals7() { DateComparer comparer = DateComparer.DefaultInvariant as DateComparer; string x = null; string y = null; Assert.IsFalse(comparer.Equals(x, "10/31/2006")); Assert.IsFalse(comparer.Equals("10/31/2006", y)); Assert.IsTrue(comparer.Equals(x, x)); Assert.IsTrue(comparer.Equals("abc", "abc")); }