public void ObserveTask_Faulted_FaultsBlock()
 {
     Test.Async(async () =>
     {
         var block = new BufferBlock<int>();
         var dataflowProgress = new DataflowProgress<int>(block);
         IProgress<int> progress = dataflowProgress;
         var task = TaskShim.Run(() =>
         {
             throw new NotImplementedException();
         });
         dataflowProgress.ObserveTaskForCompletion(task);
         await AssertEx.ThrowsExceptionAsync<NotImplementedException>(block.Completion, allowDerivedTypes: false);
     });
 }
 public void ObserveTask_Faulted_FaultsBlock()
 {
     Test.Async(async() =>
     {
         var block                = new BufferBlock <int>();
         var dataflowProgress     = new DataflowProgress <int>(block);
         IProgress <int> progress = dataflowProgress;
         var task = TaskShim.Run(() =>
         {
             throw new NotImplementedException();
         });
         dataflowProgress.ObserveTaskForCompletion(task);
         await AssertEx.ThrowsExceptionAsync <NotImplementedException>(block.Completion, allowDerivedTypes: false);
     });
 }
 public void ObserveTask_Completed_CompletesBlock()
 {
     Test.Async(async () =>
     {
         var block = new BufferBlock<int>();
         var dataflowProgress = new DataflowProgress<int>(block);
         IProgress<int> progress = dataflowProgress;
         var task = TaskShim.Run(() =>
         {
             progress.Report(13);
         });
         dataflowProgress.ObserveTaskForCompletion(task);
         var report1 = block.Receive();
         Assert.AreEqual(13, report1);
         await block.Completion;
     });
 }
 public void ObserveTask_Completed_CompletesBlock()
 {
     Test.Async(async() =>
     {
         var block                = new BufferBlock <int>();
         var dataflowProgress     = new DataflowProgress <int>(block);
         IProgress <int> progress = dataflowProgress;
         var task = TaskShim.Run(() =>
         {
             progress.Report(13);
         });
         dataflowProgress.ObserveTaskForCompletion(task);
         var report1 = block.Receive();
         Assert.AreEqual(13, report1);
         await block.Completion;
     });
 }