Exemple #1
0
        public void CSVFileReader_MultipleCleanups()
        {
            FileDataReader reader   = new FileDataReader();
            string         filePath = GetTempFilePath();

            reader.Open(filePath);

            Assert.DoesNotThrow(() => reader.Close());
            Assert.DoesNotThrow(() => reader.Close());
        }
Exemple #2
0
        public void CSVFileReader_DoubleInitialization()
        {
            FileDataReader reader   = new FileDataReader();
            string         filePath = GetTempFilePath();

            reader.Open(filePath);
            Assert.Throws <InvalidOperationException>(() => reader.Open(GetTempFilePath()));
            reader.Close();
        }
Exemple #3
0
        public void CSVFileReader_SuccessfulMultipleReads_LessData()
        {
            string filePath = GetTempFilePath();

            WriteData(filePath, "data1");

            FileDataReader reader = new FileDataReader();

            reader.Open(filePath);

            Assert.DoesNotThrow(() => reader.ReadLine());
            Assert.DoesNotThrow(() => reader.ReadLine());
            reader.Close();
        }
Exemple #4
0
        public void CSVFileReader_SuccessfulRead()
        {
            string filePath = GetTempFilePath();

            WriteData(filePath, "somedata");

            FileDataReader reader = new FileDataReader();

            reader.Open(filePath);

            string dataRead = null;

            Assert.DoesNotThrow(() => dataRead = reader.ReadLine());
            Assert.AreEqual("somedata", dataRead);

            reader.Close();
        }
Exemple #5
0
        public void CSVFileReader_CleanupWithoutInitialization()
        {
            FileDataReader reader = new FileDataReader();

            Assert.DoesNotThrow(() => reader.Close());
        }