コード例 #1
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();
        }
コード例 #2
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();
        }
コード例 #3
0
        public void CSVFileReader_ReadWithoutInitialization()
        {
            FileDataReader reader = new FileDataReader();

            Assert.Throws <InvalidOperationException>(() => reader.ReadLine());
        }