public void Compare_xxxxyyyy_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare("2013-10-16", new DateTime(2013, 10, 16)); Assert.That(result.AreEqual, Is.True); }
public void Compare_StringAndValue_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare("2013-10-16", "(value)"); Assert.That(result.AreEqual, Is.True); }
public void Compare_ValidDateAndAny_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare("2013-10-16", "(any)"); Assert.That(result.AreEqual, Is.True); }
public void Compare_NullAndValue_False() { var comparer = new DateTimeComparer(); var result = comparer.Compare(null, "(value)"); Assert.That(result.AreEqual, Is.False); }
public void Compare_StringAndAny_ArgumentException() { var comparer = new DateTimeComparer(); Assert.Throws<ArgumentException>(delegate {comparer.Compare("Not a date", "(any)");}); }
public void Compare_NullAndNullPlaceHolder_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare(null, "(null)"); Assert.That(result.AreEqual, Is.True); }
public void Compare_NullAndString_False() { var comparer = new DateTimeComparer(); var result = comparer.Compare(null, new DateTime(2013, 10, 16)); Assert.That(result.AreEqual, Is.False); }
public void Compare_NullAndAny_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare(null, "(any)"); Assert.That(result.AreEqual, Is.True); }
public void Compare_mmddyyyy_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare("10/16/2013", new DateTime(2013,10,16)); Assert.That(result.AreEqual, Is.True); }
public void Compare_yyyymmddWithToleranceInMilliSeconds_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare("2013-10-08 01:00:00.500", "2013-10-08 01:00:00.550", "00:00:00.125"); Assert.That(result.AreEqual, Is.True); }
public void Compare_yyyymmddWithToleranceInHours_True() { var comparer = new DateTimeComparer(); var result = comparer.Compare("2013-10-09", "2013-10-08 06:00:00", "22:30:00"); Assert.That(result.AreEqual, Is.True); }
public void Compare_yyyymmddWithToleranceInDays_False() { var comparer = new DateTimeComparer(); var result = comparer.Compare("2013-10-09", "2013-10-01", "1"); Assert.That(result.AreEqual, Is.False); }