예제 #1
0
 public ScopedContext(AsyncTestHarness harness)
 {
     ConsumeContext      = harness.GetTask <ConsumeContext>();
     ConsumeContextEasyA = harness.GetTask <ConsumeContext <EasyA> >();
     ConsumeContextEasyB = harness.GetTask <ConsumeContext <EasyB> >();
     SendContext         = harness.GetTask <SendContext>();
 }
예제 #2
0
            public ScopedContext(TaskCompletionSource <ScopedContext> taskCompletionSource, AsyncTestHarness harness)
            {
                ConsumeContext      = harness.GetTask <ConsumeContext>();
                ConsumeContextEasyA = harness.GetTask <ConsumeContext <EasyA> >();
                ConsumeContextEasyB = harness.GetTask <ConsumeContext <EasyB> >();
                SendContext         = harness.GetTask <SendContext>();

                taskCompletionSource.TrySetResult(this);
            }
예제 #3
0
 public PublishObserver(AsyncTestHarness fixture)
 {
     _postSend    = fixture.GetTask <PublishContext>();
     _preSend     = fixture.GetTask <PublishContext>();
     _sendFaulted = fixture.GetTask <PublishContext>();
 }
예제 #4
0
 /// <summary>
 /// Returns a task completion that is automatically canceled when the test is canceled
 /// </summary>
 /// <typeparam name="T">The task type</typeparam>
 /// <returns></returns>
 public TaskCompletionSource <T> GetTask <T>()
 {
     return(AsyncTestHarness.GetTask <T>());
 }