예제 #1
0
 public void Failed0()
 {
     AsyncContext.Run(async() =>
     {
         await AssertEx.ThrowsExceptionAsync <InvalidOperationException>(AsyncFactory.FromApm(BeginFail0, End));
     });
 }
예제 #2
0
 public void Cancelled0()
 {
     AsyncContext.Run(async() =>
     {
         await AssertEx.CompletesCanceledAsync(AsyncFactory.FromApm(BeginCancel0, End));
     });
 }
예제 #3
0
 public void Args0()
 {
     AsyncContext.Run(async() =>
     {
         await AsyncFactory.FromApm(BeginSuccess0, End);
     });
 }
예제 #4
0
 public void Args0()
 {
     Test.Async(async() =>
     {
         await AsyncFactory.FromApm(BeginSuccess0, End);
     });
 }
예제 #5
0
 public void Args14()
 {
     AsyncContext.Run(async() =>
     {
         IntReference counter = new IntReference();
         await AsyncFactory.FromApm(BeginSuccess14, End, counter, counter, counter, counter, counter, counter, counter, counter, counter, counter, counter, counter, counter, counter);
         Assert.AreEqual(1, counter.Value);
     });
 }
예제 #6
0
 public void Args9()
 {
     Test.Async(async() =>
     {
         IntReference counter = new IntReference();
         await AsyncFactory.FromApm(BeginSuccess9, End, counter, counter, counter, counter, counter, counter, counter, counter, counter);
         Assert.AreEqual(1, counter.Value);
     });
 }
예제 #7
0
 protected Task IfHasPendingThenFlushTrackingRecordsAsync()
 {
     if (this.Controller.HasPendingTrackingRecords)
     {
         return(AsyncFactory.FromApm <TimeSpan>(this.Controller.BeginFlushTrackingRecords, this.Controller.EndFlushTrackingRecords, this.Parameters.TrackingTimeout));
     }
     else
     {
         return(TaskConstants.Completed);
     }
 }
예제 #8
0
 public static Task OnSaveAsync(this System.Activities.Persistence.PersistenceIOParticipant persistenceIOParticipant,
                                IDictionary <XName, object> readWriteValues, IDictionary <XName, object> writeOnlyValues, TimeSpan timeout)
 => AsyncFactory.FromApm <IDictionary <XName, object>, IDictionary <XName, object>, TimeSpan>(
     persistenceIOParticipant.BeginOnSave, persistenceIOParticipant.EndOnSave,
     readWriteValues, writeOnlyValues, timeout);