コード例 #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>());
 }