Beispiel #1
0
 public void TestResult()
 {
     SyncResult result;
      result = new SyncResult(null, null, null);
      Assert.AreEqual(result.GetResult(), null);
      Assert.AreEqual(result.GetResult<String>(), null);
      Assert.IsTrue(result.IsCompleted);
      result = new SyncResult(null, null, "complete");
      Assert.AreEqual(result.GetResult(), "complete");
      Assert.AreEqual(result.GetResult<String>(), "complete");
      try
      {
     result.GetResult<Int32>();
     Assert.Fail("InvalidCastException expected");
      }
      catch (InvalidCastException) { }
      Assert.IsTrue(result.IsCompleted);
 }