public void NukeAllPackages() { Upbring upbring = Upbring.Instance(); foreach (InstalledPackage package in upbring.InstalledPackage) { package.Nuke(); upbring.RemovePackage(package); } //TODO: Remove file when Upbring properly removes everything Upbring.RemoveFile(); }
public void NukeAllPackages() { Upbring upbring = Upbring.Instance(); using (LogAggregator LA = LogAggregator.InUnity( "{0} packages were successfully nuked", "{0} packages were successfully nuked but warnings were raised", "Some errors occured while nuking {0} packages", upbring.InstalledPackage.Length )) { foreach (InstalledPackage package in upbring.InstalledPackage) { package.Nuke(); upbring.RemovePackage(package); } //TODO: Remove file when Upbring properly removes everything Upbring.RemoveFile(); } }
public void RemoveFileTest() { try { Directory.CreateDirectory(temp_dir); Directory.SetCurrentDirectory(temp_dir); string repo_path = Path.Combine(temp_dir, Path.GetRandomFileName()); Directory.CreateDirectory(repo_path); Upfile dummy = new Upfile() { Configuration = new Configuration() { RepositoryPath = new PathConfiguration() { Location = repo_path } }, Dependencies = new DependencyDefinition[0], Repositories = new Repository[0], UnityVersion = "foo" }; UpfileExposer.SetInstance(dummy); string upbring_path = Path.Combine(repo_path, "Upbring.xml"); File.Create(upbring_path).Dispose(); Upbring.RemoveFile(); Assert.IsFalse(File.Exists(upbring_path)); } finally { Directory.SetCurrentDirectory(pwd); Directory.Delete(temp_dir, true); } }