コード例 #1
0
 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);
 }
コード例 #2
0
 public void Compare_StringAndValue_True()
 {
     var comparer = new DateTimeComparer();
     var result = comparer.Compare("2013-10-16", "(value)");
     Assert.That(result.AreEqual, Is.True);
 }
コード例 #3
0
 public void Compare_ValidDateAndAny_True()
 {
     var comparer = new DateTimeComparer();
     var result = comparer.Compare("2013-10-16", "(any)");
     Assert.That(result.AreEqual, Is.True);
 }
コード例 #4
0
 public void Compare_NullAndValue_False()
 {
     var comparer = new DateTimeComparer();
     var result = comparer.Compare(null, "(value)");
     Assert.That(result.AreEqual, Is.False);
 }
コード例 #5
0
 public void Compare_StringAndAny_ArgumentException()
 {
     var comparer = new DateTimeComparer();
     Assert.Throws<ArgumentException>(delegate {comparer.Compare("Not a date", "(any)");});
 }
コード例 #6
0
 public void Compare_NullAndNullPlaceHolder_True()
 {
     var comparer = new DateTimeComparer();
     var result = comparer.Compare(null, "(null)");
     Assert.That(result.AreEqual, Is.True);
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 public void Compare_NullAndAny_True()
 {
     var comparer = new DateTimeComparer();
     var result = comparer.Compare(null, "(any)");
     Assert.That(result.AreEqual, Is.True);
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 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);
 }
コード例 #11
0
 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);
 }
コード例 #12
0
 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);
 }