예제 #1
0
 public void ProgressReports_AreSentToCollection()
 {
     Test.Async(async() =>
     {
         var queue = new ConcurrentQueue <int>();
         IProgress <int> progress = new ProducerProgress <int>(queue);
         await TaskShim.Run(() =>
         {
             progress.Report(13);
             progress.Report(17);
         });
         Assert.IsTrue(queue.SequenceEqual(new[] { 13, 17 }));
     });
 }
 public void ProgressReports_AreSentToCollection()
 {
     Test.Async(async () =>
     {
         var queue = new ConcurrentQueue<int>();
         IProgress<int> progress = new ProducerProgress<int>(queue);
         await TaskShim.Run(() =>
         {
             progress.Report(13);
             progress.Report(17);
         });
         Assert.IsTrue(queue.SequenceEqual(new[] { 13, 17 }));
     });
 }