Пример #1
0
        public void GetFileTest(string path)
        {
            GgpkArchive archive = GgpkArchive.From(new FileInfo(@"pass.ggpk"));
            IGgpkFile   file    = archive.GetFile(path);

            Assert.AreEqual(4UL, file.Length);
        }
Пример #2
0
        public void TestArchive()
        {
            string poePath = Environment.GetEnvironmentVariable("POE_PATH");

            if (string.IsNullOrEmpty(poePath))
            {
                Assert.Inconclusive("Environment variable POE_PATH not defined - skipping test");
            }

            string contentFile = Path.Combine(poePath, "content.ggpk");

            if (!File.Exists(contentFile))
            {
                Assert.Inconclusive("content.ggpk not found - skipping test");
            }

            GgpkArchive archive = GgpkArchive.From(contentFile);

            Assert.IsNotNull(archive.Root);

            IEnumerable <IGgpkFile> files = archive.Root.ToFileList();

            foreach (var file in files)
            {
                StringAssert.StartsWith(file.FullName, "/");
                Assert.AreEqual(false, file.FullName.Contains('\\', StringComparison.InvariantCultureIgnoreCase));
            }

            IGgpkDirectory dialogueDirectory = archive.GetDirectory("/Audio/Dialogue/");

            Assert.IsNotNull(dialogueDirectory);

            IGgpkFile noAudioFoundFile = archive.GetFile("/Audio/NoFileFound.ogg");

            Assert.IsNotNull(noAudioFoundFile);
        }
Пример #3
0
 public void GetFileNotFoundTest()
 {
     GgpkArchive archive = GgpkArchive.From(new FileInfo(@"pass.ggpk"));
     IGgpkFile   file    = archive.GetFile("/Dir_1/i_do_not_exist.non");
 }
Пример #4
0
 public void GetFileDirectoryNotFoundTest()
 {
     GgpkArchive archive = GgpkArchive.From(new FileInfo(@"pass.ggpk"));
     IGgpkFile   file    = archive.GetFile("/NonExistingDirectory/test-file-1.bin");
 }