protected void CleanUp() { // Clean the UpfileHandler UpfileExposer.ClearInstance(); Helper.ClearRunDirectory(); }
protected void BeforeEach() { // Upfile Cleanup UpfileExposer.ClearInstance(); // Move to test running directory Helper.InitializeRunDirectory(); Directory.SetCurrentDirectory(Helper.testRunDirectoryName); }
protected void AfterAllTests() { UpfileExposer.ClearInstance(); }
protected void BeforeEachTest() { UpfileExposer.ClearInstance(); }
protected void Given() { UpliftManagerExposer.ClearAllInstances(); pwd = Directory.GetCurrentDirectory(); Helper.InitializeRunDirectory(); try { Directory.SetCurrentDirectory(Helper.testRunDirectoryName); // Upfile Setup for filler package upfile_path = Helper.GetLocalFilePath("..", "TestData", "PackageNuking", "Init_Upfile.xml"); try { UpfileExposer.SetInstance(UpfileExposer.LoadTestXml(upfile_path)); } catch (FileNotFoundException) { Console.WriteLine("Make sure you are running the test from UpliftTesting/TestResults. The Upfile.xml uses the current path to register the repositories."); Assert.Fail("The test could not run correctly. See console message."); } UpfileExposer.TestingInstance(); manager = UpliftManager.Instance(); // Creating original state Directory.CreateDirectory("Assets"); Directory.CreateDirectory("Assets/Media"); File.Create("Assets/scriptA.cs").Dispose(); File.Create("Assets/scriptB.cs").Dispose(); File.Create("Assets/Media/mediaA.txt").Dispose(); File.Create("Assets/Media/mediaB.txt").Dispose(); // Install Filler Package manager.InstallDependencies(); // Save the snapshot original_snapshot = GetSnapshot(); // Proper Upfile Setup UpliftManagerExposer.ClearAllInstances(); UpfileExposer.ClearInstance(); upfile_path = Helper.GetLocalFilePath("..", "TestData", "PackageNuking", "Upfile.xml"); try { UpfileExposer.SetInstance(UpfileExposer.LoadTestXml(upfile_path)); } catch (FileNotFoundException) { Console.WriteLine("Make sure you are running the test from UpliftTesting/TestResults. The Upfile.xml uses the current path to register the repositories."); Assert.IsTrue(false, "The test could not run correctly. See console message."); } Upfile.Instance(); manager = UpliftManager.Instance(); } finally { Directory.SetCurrentDirectory(pwd); } }
protected void CleanUp() { // Remove (hopefully) installed files UpfileExposer.ClearInstance(); Helper.ClearRunDirectory(); }
protected void Init() { upbring = new Upbring(); temp_dir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); UpfileExposer.ClearInstance(); }