示例#1
0
        public void Extract_TestMPK_SameTxtContent()
        {
            var mpk = new MPK.MPK(mpkFileLocation, false);

            mpk.Extract(extractPath);

            var actualFileText   = File.ReadAllText(Path.Combine(extractPath, textFileLocation));
            var expectedFileText = textFileContent;

            Assert.AreEqual(expectedFileText, actualFileText);
        }
示例#2
0
        public void Save_TestTxtToMPK_CorrectCRC()
        {
            var newMPK  = new MPK.MPK(mpkFileLocation, true);
            var mpkFile = new MPKFile(textFileLocation);

            newMPK.AddFile(mpkFile);
            newMPK[textFileLocation].Header.TimeStamp = 0; //Make MPK creation deterministic

            newMPK.Save();
            Assert.AreEqual(1, newMPK.Count);

            var expectedCRCValue = 375344986;

            Assert.AreEqual(expectedCRCValue, newMPK.CRCValue);
        }
示例#3
0
 public void Open_TestMPK_NoExceptions()
 {
     _ = new MPK.MPK(mpkFileLocation, false);
 }