public void ShouldOpenFileAndReadStream() { var mockstream = new Mock <Stream>(); mockstream.Setup(x => x.CanRead).Returns(true); var streamreader = new StreamReader(mockstream.Object); _csvWriter.Open(Filename); var stream = _csvWriter.GetWriter(); Assert.That(stream, Is.EqualTo(streamreader)); _csvWriter.Close(); }
public void Close() { _csvWriter?.Close(); _csvWriter = null; _csvReader?.Close(); _csvReader = null; }
public void Close() { IsWriterInitialized(); IsReaderInitialized(); _writer.Close(); _reader.Close(); }
public void Close() { if (contactsReader != null) { contactsReader.Close(); } if (csvWriter != null) { csvWriter.Close(); } }
/*************************************************************************************************/ public void UpdateUsersCSVFile(string filename, List <User> encryptedUsers) { if (encryptedUsers == null) { throw new ArgumentNullException(nameof(encryptedUsers)); } _writer.Initialize(filename); foreach (var user in encryptedUsers) { _writer.WriteLine(user.GetUserString()); } _writer.Close(); }
/*************************************************************************************************/ public void UpdatePasswordCSVFile(string filename, List <DatabasePassword> encryptedPasswords) { if (encryptedPasswords == null) { throw new ArgumentNullException(nameof(encryptedPasswords)); } _writer.Initialize(filename); foreach (var password in encryptedPasswords) { _writer.WriteLine(password.GetPasswordString()); } _writer.Close(); }
public void Close() { _csvReader.Close(); _csvWriter.Close(); }