public void FileCompareDifExt()
        {
            string fileOne = CheckFile.GetPath(TestContext.DataRow[FILE_TO_COMPARE_ONE].ToString());
            string fileTwo = CheckFile.GetPath(TestContext.DataRow[COMPARE_FILE].ToString());

            Assert.IsFalse(CheckFile.CompareFile(fileOne, fileTwo), "File Compare Funct");
        }
        public void FileCompareSameExtAreEqual()
        {
            string fileOne = CheckFile.GetPath(TestContext.DataRow[FILE_TO_COMPARE_ONE].ToString());
            string fileTwo = CheckFile.GetPath(TestContext.DataRow[FILE_TO_COMPARE_ONE].ToString());

            Assert.IsTrue(CheckFile.CompareFile(@fileOne, @fileTwo), "File Compare Funct");
        }
Ejemplo n.º 3
0
 /// <summary>
 /// test to make sure that two different files compress differently
 /// </summary>
 /// <param name="uncompressedOne">first starting path</param>
 /// <param name="uncompressedTwo">second starting path</param>
 /// <param name="compressedOne">first compressed file</param>
 /// <param name="compressedTwo">second compressed file</param>
 public void TestDifFileCompression(string uncompressedOne, string uncompressedTwo,
                                    string compressedOne, string compressedTwo)
 {
     TestFileCompression(uncompressedOne, compressedOne);
     TestFileCompression(uncompressedTwo, compressedTwo);
     Assert.IsFalse(CheckFile.CompareFile(uncompressedOne, uncompressedTwo),
                    " Files are not different");
     Assert.IsFalse(CheckFile.CompareFile(compressedOne, compressedTwo),
                    " Files did not compress differently");
 }
Ejemplo n.º 4
0
 /// <summary>
 /// test whether two equal files compressed the same
 /// </summary>
 /// <param name="uncompressedOne">first starting path</param>
 /// <param name="uncompressedTwo">second starting path</param>
 /// <param name="compressedOne">first compressed file</param>
 /// <param name="compressedTwo">second compressed file</param>
 public void TestSameFileCompression(string uncompressedOne, string uncompressedTwo,
                                     string compressedOne, string compressedTwo)
 {
     TestFileCompression(uncompressedOne, compressedOne);
     TestFileCompression(uncompressedTwo, compressedTwo);
     Assert.IsTrue(CheckFile.CompareFile(uncompressedOne, uncompressedTwo),
                   "{0} is not identical to {1}", Path.GetFileName(uncompressedOne),
                   Path.GetFileName(uncompressedTwo));
     Assert.IsTrue(CheckFile.CompareFile(compressedOne, compressedTwo),
                   "{0} did not compress in the same format as {1}", Path.GetFileName(compressedOne),
                   Path.GetFileName(compressedTwo));
 }
Ejemplo n.º 5
0
        public void DecompressFileTest()
        {
            string fileToCompress = TestContext.DataRow[FILE_TO_COMPRESS].ToString();
            string compressedFile = TestContext.DataRow[COMPRESSED_FILE].ToString();
            string decompressed   = TestContext.DataRow[DECOMPRESSED_FILE].ToString();

            tree.Compress(fileToCompress, compressedFile);
            TestFileCompression(fileToCompress, compressedFile);
            tree.Decompress(compressedFile, decompressed);
            TestFileCompression(decompressed, compressedFile);
            Assert.IsTrue(CheckFile.CompareFile(fileToCompress, decompressed), "Files are not the same");
        }
Ejemplo n.º 6
0
        public void DecompressFileDifFileTest()
        {
            string fileToCompressOne = TestContext.DataRow[FILE_TO_COMPRESS + ONE_KEYWORD].ToString();
            string fileToCompressTwo = TestContext.DataRow[FILE_TO_COMPRESS + TWO_KEYWORD].ToString();
            string compressedFileOne = TestContext.DataRow[COMPRESSED_FILE + ONE_KEYWORD].ToString();
            string compressedFileTwo = TestContext.DataRow[COMPRESSED_FILE + TWO_KEYWORD].ToString();
            string decompressedOne   = TestContext.DataRow[DECOMPRESSED_FILE + ONE_KEYWORD].ToString();
            string decompressedTwo   = TestContext.DataRow[DECOMPRESSED_FILE + TWO_KEYWORD].ToString();
            Task   CmprsOne          = Task.Run(() => tree.Compress(fileToCompressOne, compressedFileOne));
            Task   ComprsTwo         = Task.Run(() => tree.Compress(fileToCompressTwo, compressedFileTwo));

            Task.WaitAll(CmprsOne, ComprsTwo);
            TestDifFileCompression(fileToCompressOne, fileToCompressTwo, compressedFileOne, compressedFileTwo);
            Task DcmprsOne = Task.Run(() => tree.Decompress(compressedFileOne, decompressedOne));
            Task DcmprsTwo = Task.Run(() => tree.Decompress(compressedFileTwo, decompressedTwo));

            Task.WaitAll(DcmprsOne, DcmprsTwo);
            TestDifFileCompression(decompressedOne, decompressedTwo, compressedFileOne, compressedFileTwo);
            Assert.IsTrue(CheckFile.CompareFile(fileToCompressOne, decompressedOne), "Files are not the same");
            Assert.IsTrue(CheckFile.CompareFile(fileToCompressTwo, decompressedTwo), "Files are not the same");
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Tests to see Compression occured
 /// </summary>
 /// <param name="fileToCompress">intial state of the file</param>
 /// <param name="compressedFile">compressed file</param>
 public void TestFileCompression(string fileToCompress, string compressedFile)
 {
     Assert.IsFalse(CheckFile.CompareFile(fileToCompress, compressedFile),
                    "Did not compress Correctly");
 }
        public void FileCompareSameFile()
        {
            string fileOne = CheckFile.GetPath(TestContext.DataRow[RESOURCE_FILE].ToString());

            Assert.IsTrue(CheckFile.CompareFile(fileOne, fileOne), "File Compare Funct");
        }