public void ReadFileAndCheckRowCount() { TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.sha1"); Sha1File sumFile = new Sha1File(); List <Pair <string> > itemList = sumFile.ReadData(reader); Assert.AreEqual(itemList.Count, _testFile1RowCount); }
public void WriteHeader() { StreamWriter fileOut = new StreamWriter(@"../../TestData/UnitTestFolder/TestFileWrite1.Sha1", false); Sha1File sumFile = new Sha1File(); sumFile.Header(fileOut); fileOut.Close(); Assert.IsTrue(File.Exists(@"../../TestData/UnitTestFolder/TestFileWrite1.sha1")); string[] lines = File.ReadAllLines(@"../../TestData/UnitTestFolder/TestFileWrite1.sha1"); Assert.GreaterOrEqual(lines.Length, 1); File.Delete(@"../../TestData/UnitTestFolder/TestFileWrite1.sha1"); }
public void ReadFile() { TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.sha1"); Sha1File sumFile = new Sha1File(); 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++; } }
public void WriteSums() { StreamWriter fileOut = new StreamWriter(@"../../TestData/UnitTestFolder/TestFileWrite2.sha1", false); Sha1File sumFile = new Sha1File(); sumFile.WriteDataRow(fileOut, "94a3225c6bac573a06da75b05bcf6de59f65db2c", "test.txt"); fileOut.Close(); Assert.IsTrue(File.Exists(@"../../TestData/UnitTestFolder/TestFileWrite2.sha1")); string[] lines = File.ReadAllLines(@"../../TestData/UnitTestFolder/TestFileWrite2.sha1"); Assert.AreEqual(1, lines.Length); Assert.IsTrue(lines[0] == "94a3225c6bac573a06da75b05bcf6de59f65db2c test.txt"); File.Delete(@"../../TestData/UnitTestFolder/TestFileWrite2.sha1"); }
public void ReadFileAndCheckRowCount() { TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.sha1"); Sha1File sumFile = new Sha1File(); List<Pair<string>> itemList = sumFile.ReadData(reader); Assert.AreEqual(itemList.Count, _testFile1RowCount); }
public void ReadFile() { TextFileReader reader = new TextFileReader(TestFolder + "TestFile1.sha1"); Sha1File sumFile = new Sha1File(); 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++; } }