Пример #1
0
        public void ReadFileAndCheckRowCount()
        {
            TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.SFV");

            SFVFile sumFile = new SFVFile();
            List <Pair <string> > itemList = sumFile.ReadData(reader);

            Assert.AreEqual(itemList.Count, _testFile1RowCount);
        }
Пример #2
0
        public void WriteHeader()
        {
            StreamWriter fileOut = new StreamWriter(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV", false);
            SFVFile      sumFile = new SFVFile();

            sumFile.Header(fileOut);
            fileOut.Close();

            Assert.IsTrue(File.Exists(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV"));

            string[] lines = File.ReadAllLines(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV");
            Assert.GreaterOrEqual(lines.Length, 1);

            File.Delete(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV");
        }
Пример #3
0
        public void WriteSums()
        {
            StreamWriter fileOut = new StreamWriter(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV", false);
            SFVFile      sumFile = new SFVFile();

            sumFile.WriteDataRow(fileOut, "692ccfbd", "test.txt");
            fileOut.Close();

            Assert.IsTrue(File.Exists(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV"));

            string[] lines = File.ReadAllLines(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV");
            Assert.AreEqual(1, lines.Length);
            Assert.IsTrue(lines[0] == "test.txt 692ccfbd");

            File.Delete(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV");
        }
Пример #4
0
        public void ReadFile()
        {
            TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.SFV");

            SFVFile sumFile = new SFVFile();
            List <Pair <string> > itemList = sumFile.ReadData(reader);

            int i = 0;

            foreach (Pair <string> item in itemList)
            {
                // TODO: must validity-check values!
                Assert.AreEqual(item.Item1.ToString(), _checkSum[i]);
                i++;
            }
        }
Пример #5
0
        public void WriteSums()
        {
            StreamWriter fileOut = new StreamWriter(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV", false);
            SFVFile sumFile = new SFVFile();
            sumFile.WriteDataRow(fileOut, "692ccfbd", "test.txt");
            fileOut.Close();

            Assert.IsTrue(File.Exists(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV"));

            string[] lines = File.ReadAllLines(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV");
            Assert.AreEqual(1, lines.Length);
            Assert.IsTrue(lines[0] == "test.txt 692ccfbd");

            File.Delete(@"../../TestData/UnitTestFolder/TestFileWrite2.SFV");
        }
Пример #6
0
        public void WriteHeader()
        {
            StreamWriter fileOut = new StreamWriter(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV", false);
            SFVFile sumFile = new SFVFile();
            sumFile.Header(fileOut);
            fileOut.Close();

            Assert.IsTrue(File.Exists(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV"));

            string[] lines = File.ReadAllLines(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV");
            Assert.GreaterOrEqual(lines.Length, 1);

            File.Delete(@"../../TestData/UnitTestFolder/TestFileWrite1.SFV");
        }
Пример #7
0
        public void ReadFileAndCheckRowCount()
        {
            TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.SFV");

            SFVFile sumFile = new SFVFile();
            List<Pair<string>> itemList = sumFile.ReadData(reader);

            Assert.AreEqual(itemList.Count, _testFile1RowCount);
        }
Пример #8
0
        public void ReadFile()
        {
            TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.SFV");

            SFVFile sumFile = new SFVFile();
            List<Pair<string>> itemList = sumFile.ReadData(reader);

            int i = 0;
            foreach (Pair<string> item in itemList)
            {
                // TODO: must validity-check values!
                Assert.AreEqual(item.Item1.ToString(), _checkSum[i]);
                i++;
            }
        }