protected void Init()
        {
            UpliftManagerExposer.ClearAllInstances();

            manager = UpliftManager.Instance();
            pwd     = Directory.GetCurrentDirectory();
        }
示例#2
0
        protected void Given()
        {
            UpliftManagerExposer.ClearAllInstances();

            pwd = Directory.GetCurrentDirectory();
            Helper.InitializeRunDirectory();

            try
            {
                Directory.SetCurrentDirectory(Helper.testRunDirectoryName);

                // Upfile Setup
                upfile_path = Helper.GetLocalFilePath("..", "TestData", "PackageUpdating", "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.");
                }
                upfile  = Upfile.Instance();
                manager = UpliftManager.Instance();

                upfile.Dependencies[0].Version = "1.0.0";
                manager.InstallDependencies();
                upfile.Dependencies[0].Version = "1.0.1";
            }
            finally
            {
                Directory.SetCurrentDirectory(pwd);
            }
        }
示例#3
0
        protected void BeforeEach()
        {
            // Upfile Cleanup
            UpfileExposer.ClearInstance();
            UpliftManagerExposer.ClearAllInstances();

            // Move to test running directory
            Helper.InitializeRunDirectory();
            Directory.SetCurrentDirectory(Helper.testRunDirectoryName);
        }
示例#4
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);
            }
        }
        protected void Given()
        {
            UpliftManagerExposer.ClearAllInstances();

            pwd = Directory.GetCurrentDirectory();
        }