public void ShouldOpenFileAndReadStream() { var mockstream = new Mock <Stream>(); mockstream.Setup(x => x.CanRead).Returns(true); var streamreader = new StreamReader(mockstream.Object); _csvReader.Open(Filename); var stream = _csvReader.GetStream(); Assert.That(stream, Is.EqualTo(streamreader)); _csvReader.Close(); }
public void Close() { _csvWriter?.Close(); _csvWriter = null; _csvReader?.Close(); _csvReader = null; }
public void Close() { IsWriterInitialized(); IsReaderInitialized(); _writer.Close(); _reader.Close(); }
/*================================================================================================= * PUBLIC METHODS *================================================================================================*/ /*************************************************************************************************/ public void ParseUsersCSVFile(string file) { string line; _reader.Initialize(file); line = _reader.ReadLine(); while (ValidLine(line)) { _encryptedUserList.Add(ParseLine(line)); line = _reader.ReadLine(); } _reader.Close(); }
public void Close() { _csvReader.Close(); _csvWriter.Close(); }