Exemplo n.º 1
0
 /// <summary>Error message if equal to the default constructed value.</summary>
 public static void CheckHasValue(this Instant value)
 {
     if (!value.HasValue())
     {
         throw new Exception("Required datetime value is not set.");
     }
 }
Exemplo n.º 2
0
 public void Empty()
 {
     using (var context = new UnitTestContext(this))
     {
         var empty = new Instant();
         context.Log.Assert(empty == InstantUtil.Empty, "empty == InstantUtil.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");
     }
 }