コード例 #1
0
 public async Task TestSupportResetting(string input)
 {
     using (var charReader = new AsyncLACharIterator(new StringReader(input), Capacity))
     {
         if (charReader.SupportsResetting)
         {
             var isEmpty = true;
             while (await charReader.MoveNextAsync())
             {
                 isEmpty = false;
             }
             charReader.Reset();
             Assert.That(charReader.MoveNextAsync(), Is.EqualTo(isEmpty), "Has element after resetting is not empty");
         }
         else
         {
             Assert.That(charReader.Reset, Throws.InvalidOperationException);
         }
     }
 }
コード例 #2
0
 public async Task TestSupportResetting(string input)
 {
     using (var charReader = new AsyncLACharIterator(new StringReader(input), Capacity))
     {
         if (charReader.SupportsResetting)
         {
             var isEmpty = true;
             while (await charReader.MoveNextAsync())
             {
                 isEmpty = false;
             }
             charReader.Reset();
             Assert.That(charReader.MoveNextAsync(), Is.EqualTo(isEmpty), "Has element after resetting is not empty");
         }
         else
         {
             Assert.That(charReader.Reset, Throws.InvalidOperationException);
         }
     }
 }