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(); } }
public void TestMethodInstallPackages() { EnsureInstalledTestPackages(); var testPackages = new UnitTestPackageBuilder(); CheckInstallationFiles(testPackages.GetSAE2()); CheckInstallationFiles(testPackages.GetTundra()); }
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); }
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); }