public void ShouldFailForUnreadableStream() { using (var stream = new TweakableStream(Stream.Null)) { stream.SetCanRead(false); Assert.Throws <ArgumentException>("csvStream", () => CsvAsyncInput.ForStream(stream)); } }
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); } }