Exemplo n.º 1
0
        protected void CleanUp()
        {
            // Clean the UpfileHandler
            UpfileExposer.ClearInstance();

            Helper.ClearRunDirectory();
        }
Exemplo n.º 2
0
        protected void BeforeEach()
        {
            // Upfile Cleanup
            UpfileExposer.ClearInstance();

            // Move to test running directory
            Helper.InitializeRunDirectory();
            Directory.SetCurrentDirectory(Helper.testRunDirectoryName);
        }
Exemplo n.º 3
0
 protected void AfterAllTests()
 {
     UpfileExposer.ClearInstance();
 }
Exemplo n.º 4
0
 protected void BeforeEachTest()
 {
     UpfileExposer.ClearInstance();
 }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 protected void CleanUp()
 {
     // Remove (hopefully) installed files
     UpfileExposer.ClearInstance();
     Helper.ClearRunDirectory();
 }
Exemplo n.º 7
0
 protected void Init()
 {
     upbring  = new Upbring();
     temp_dir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
     UpfileExposer.ClearInstance();
 }