Пример #1
0
        public void CloneArchiveTest()
        {
            var pboArchive = new PboArchive("testdata/cba_common.pbo");
            var files = new Dictionary<FileEntry, string>();

            foreach (var entry in pboArchive.Files)
            {
                var info = new FileInfo(Path.Combine("testdata\\cba_common",entry.FileName));
                Assert.That(info.Exists);
                files.Add(entry,info.FullName);
            }

            PboArchive.Clone("clone_common.pbo", pboArchive.ProductEntry, files, pboArchive.Checksum);

            var cloneArchive = new PboArchive("clone_common.pbo");

            Assert.That(pboArchive.Checksum.SequenceEqual(cloneArchive.Checksum), "Checksum dosen't match");

            Assert.That(pboArchive.Files.Count == cloneArchive.Files.Count, "Checksum dosen't match");

            Assert.That(pboArchive.ProductEntry.Name == cloneArchive.ProductEntry.Name);

            Assert.That(pboArchive.ProductEntry.Prefix == cloneArchive.ProductEntry.Prefix);

            Assert.That(pboArchive.ProductEntry.Addtional.Count == cloneArchive.ProductEntry.Addtional.Count);
        }
Пример #2
0
        public void OpenArchiveTest()
        {
            var pboArchive = new PboArchive("testdata/cba_common.pbo");
            Assert.That(pboArchive.Files.Count == 113);

            Assert.That(pboArchive.Checksum.SequenceEqual(_checksum),"Checksum dosen't match");

            Assert.That(pboArchive.ProductEntry.Name == "prefix");

            Assert.That(pboArchive.ProductEntry.Prefix == @"x\cba\addons\common");

            Assert.That(pboArchive.ProductEntry.Addtional.Count == 3);
        }
Пример #3
0
        public void CreateArchiveTest()
        {
            Assert.That(PboArchive.Create("testdata\\cba_common","cba_common.pbo"));

            var pbo = new PboArchive("cba_common.pbo");

            Assert.That(pbo.Files.Count == 113);

            // checksums shoulden't match due to the time.
            Assert.False(pbo.Checksum.SequenceEqual(_checksum), "Checksum match");

            Assert.That(pbo.ProductEntry.Name == "prefix");

            Assert.That(pbo.ProductEntry.Prefix == @"x\cba\addons\common");

            Assert.That(pbo.ProductEntry.Addtional.Count == 1); // i don't add wonky shit like mikero.
        }