コード例 #1
0
 public void ShouldFailForUnreadableStream()
 {
     using (var stream = new TweakableStream(Stream.Null))
     {
         stream.SetCanRead(false);
         Assert.Throws <ArgumentException>("csvStream", () => CsvAsyncInput.ForStream(stream));
     }
 }
コード例 #2
0
        public void ShouldWorkWithoutSeeking(string filePath, int chunkLength)
        {
            // arrange
            filePath = Path.Combine(TestCsvFilesFolderPath, filePath);
            using (var stream = new TweakableStream(File.OpenRead(filePath)))
            {
                stream.SetCanSeek(false);
                var sut = CsvSyncInput.ForStream(stream)
                          .WithMinReadBufferByteCount(chunkLength)
                          .WithIgnoreUTF8ByteOrderMark(false);

                // act, assert
                RunTest(sut, filePath, false);
            }
        }