Example #1
0
 public void UnpackMegFile_TestSuccess()
 {
     MegFileUtility.UnpackMegFile(TEST_DATA_PATH_IN, TEST_DATA_PATH_OUT);
     Assert.IsTrue(Directory.Exists(TEST_DATA_PATH_OUT));
     Assert.IsNotNull(Directory.GetFiles(TEST_DATA_PATH_OUT));
     foreach (string file in EXPECTED_FILES)
     {
         Assert.IsTrue(File.Exists(file));
     }
 }
        public void MegBuilderBuildFromAttributeTest()
        {
            MegFileUtility.UnpackMegFile(TEST_DATA_PATH_IN, TEST_DATA_PATH_UNPACK_OUT);
            MegFileBinaryFileBuilder builder   = new MegFileBinaryFileBuilder();
            MegFileAttribute         attribute = new MegFileAttribute
            {
                FilePath     = TEST_DATA_PATH_PACK_OUT,
                FileName     = Path.GetFileName(TEST_DATA_PATH_PACK_OUT),
                ContentFiles = EXPECTED_FILES
            };
            MegFile megFile = builder.Build(attribute);

            Assert.IsNotNull(megFile);
        }
Example #3
0
 public void PackMegFile_TestSuccess()
 {
     MegFileUtility.UnpackMegFile(TEST_DATA_PATH_IN, TEST_DATA_PATH_OUT);
     MegFileUtility.PackMegFile(TEST_DATA_PATH_BUILD, EXPECTED_FILES);
     Assert.IsTrue(File.Exists(TEST_DATA_PATH_BUILD));
     if (Directory.Exists(TEST_DATA_PATH_OUT))
     {
         Directory.Delete(TEST_DATA_PATH_OUT, true);
     }
     MegFileUtility.UnpackMegFile(TEST_DATA_PATH_BUILD, TEST_DATA_PATH_OUT);
     Assert.IsTrue(Directory.Exists(TEST_DATA_PATH_OUT));
     Assert.IsNotNull(Directory.GetFiles(TEST_DATA_PATH_OUT));
     foreach (string file in EXPECTED_FILES)
     {
         Assert.IsTrue(File.Exists(file));
     }
 }
Example #4
0
 public void UnpackMegFile_TestDirectoryOutNull()
 {
     MegFileUtility.UnpackMegFile(TEST_DATA_PATH_IN, null);
 }
Example #5
0
 public void UnpackMegFile_TestDirectoryOutInvalid()
 {
     MegFileUtility.UnpackMegFile(TEST_DATA_PATH_IN, "");
 }