コード例 #1
0
 /// <summary>Error message if equal to the default constructed value.</summary>
 public static void CheckHasValue(this LocalDateTime value)
 {
     if (!value.HasValue())
     {
         throw new Exception("Required datetime value is not set.");
     }
 }
コード例 #2
0
 public void Empty()
 {
     using (var context = new UnitTestContext(this))
     {
         var empty = new LocalDateTime();
         context.Log.Assert(empty == LocalDateTimeUtil.Empty, "empty == LocalDateTimeUtil.Empty");
         context.Log.Assert(empty.HasValue() == false, "empty.HasValue() == false");
         context.Log.Assert(empty.ToIsoString() == String.Empty, "empty.ToIsoString() == String.Empty");
         context.Log.Assert(empty.AsString() == String.Empty, "empty.AsString() == String.Empty");
     }
 }