예제 #1
0
        private void EnsureTestPackages()
        {
            var testPackages = new UnitTestPackageBuilder();
            var testp        = testPackages.GetSAE1();

            if (!File.Exists(testp.FileName()))
            {
                testPackages.TestMethodCreatePackageSAE1();
            }

            testp = testPackages.GetSAE2();
            if (!File.Exists(testp.FileName()))
            {
                testPackages.TestMethodCreatePackageSAE2();
            }

            testp = testPackages.GetShadow();
            if (!File.Exists(testp.FileName()))
            {
                testPackages.TestMethodCreatePackageShadow();
            }

            testp = testPackages.GetTundra();
            if (!File.Exists(testp.FileName()))
            {
                testPackages.TestMethodCreatePackageTundra();
            }
        }
예제 #2
0
        public void TestMethodInstallPackages()
        {
            EnsureInstalledTestPackages();

            var testPackages = new UnitTestPackageBuilder();

            CheckInstallationFiles(testPackages.GetSAE2());
            CheckInstallationFiles(testPackages.GetTundra());
        }
예제 #3
0
        public void TestMethodRemovePackageShadow()
        {
            var database = new LocalDatabase("database", new PackageInstaller());


            EnsureInstalledTestPackages();

            var testPackages = new UnitTestPackageBuilder();
            var testp        = testPackages.GetShadow();

            database.UninstallPackage(testp);

            CheckInstallationFiles(testPackages.GetSAE2());
            CheckInstallationFiles(testPackages.GetTundra());

            Assert.IsTrue(true);
        }
예제 #4
0
        private void EnsureInstalledTestPackages()
        {
            if (Directory.Exists("wot_home\\res_mods"))
            {
                Directory.Delete("wot_home\\res_mods", true);
            }
            Directory.CreateDirectory("wot_home\\res_mods");

            var database = new LocalDatabase("database", new PackageInstaller());

            database.Init("wot_home", "0.9.13", true);

            EnsureTestPackages();

            var testPackages = new UnitTestPackageBuilder();
            var testp        = testPackages.GetSAE1();

            database.InstallPackage(File.OpenRead(testp.FileName()));
            Assert.IsTrue(database.GetInstalledPackages().ExistsByName(testp));

            CheckInstallationFiles(testp);

            testp = testPackages.GetSAE2();
            database.InstallPackage(File.OpenRead(testp.FileName()));
            Assert.IsTrue(database.GetInstalledPackages().ExistsByName(testp));

            CheckInstallationFiles(testp);


            testp = testPackages.GetShadow();
            database.InstallPackage(File.OpenRead(testp.FileName()));
            Assert.IsTrue(database.GetInstalledPackages().ExistsByName(testp));

            CheckInstallationFiles(testp);


            testp = testPackages.GetTundra();
            database.InstallPackage(File.OpenRead(testp.FileName()));
            Assert.IsTrue(database.GetInstalledPackages().ExistsByName(testp));

            CheckInstallationFiles(testp);
        }