예제 #1
0
        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();
        }
예제 #2
0
 public void Close()
 {
     _csvWriter?.Close();
     _csvWriter = null;
     _csvReader?.Close();
     _csvReader = null;
 }
예제 #3
0
        public void Close()
        {
            IsWriterInitialized();
            IsReaderInitialized();

            _writer.Close();
            _reader.Close();
        }
예제 #4
0
        /*=================================================================================================
        *       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();
        }
예제 #5
0
 public void Close()
 {
     _csvReader.Close();
     _csvWriter.Close();
 }