コード例 #1
0
        public void Test_GetRedirectPath_Maintenance()
        {
            Uri url = new Uri("http://localhost/Test/Default.aspx");

            string applicationName = "TestApplication";

            string pathVariation = "testing";

            string appConfigPath = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Application." + pathVariation + ".config";

            string legacyDirectory = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Legacy";

            CreateMockLegacy(legacyDirectory);

            SetupChecker checker = new SetupChecker(url, applicationName);
            checker.Installer = new ApplicationInstaller(applicationName, pathVariation,
                                                        new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName));

            checker.Restorer = new ApplicationRestorer(new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName));
            checker.Restorer.LegacyDirectoryPath = legacyDirectory;

            string redirectPath = checker.GetRedirectPath();

            string expected = applicationName + "/Maintenance.html";

            Assert.AreEqual(expected.ToLower(), redirectPath.ToLower(), "The redirect path didn't return the expected value.");
        }
コード例 #2
0
        public void Test_GetRedirectPath_Setup()
        {
            Uri url = new Uri("http://localhost/Test/Default.aspx");

            string applicationName = "TestApplication";

            string pathVariation = "testing";

            string appConfigPath = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Application." + pathVariation + ".config";

            IFileMapper fileMapper = new MockFileMapper(this, TestUtilities.GetTestingPath(this), applicationName);

            SetupChecker checker = new SetupChecker(url, applicationName, fileMapper);

            checker.Installer = new ApplicationInstaller(applicationName, pathVariation, fileMapper);
            //checker.Installer = new ApplicationInstaller(applicationName, pathVariation);
            //checker.Installer.FileMapper = new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName);

            //checker.Restorer = new ApplicationRestorer();


            string redirectPath = checker.GetRedirectPath();

            string expected = applicationName + "/Admin/Setup.aspx";

            Assert.AreEqual(expected.ToLower(), redirectPath.ToLower(), "The redirect path didn't return the expected value.");
        }
コード例 #3
0
        public void Test_GetRedirectPath_NoRedirect()
        {
            Uri url = new Uri("http://localhost/Test/Default.aspx");

            string applicationName = "TestApplication";

            string pathVariation = "testing";

            string appConfigPath = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Application." + pathVariation + ".config";

            CreateMockConfig(appConfigPath);

            SetupChecker checker = new SetupChecker(url, applicationName);

            checker.Installer  = new ApplicationInstaller(applicationName, pathVariation);
            checker.FileMapper = new MockFileMapper(this, TestUtilities.GetTestingPath(this), applicationName);


            checker.Restorer = new ApplicationRestorer(new MockFileMapper(this, TestUtilities.GetTestingPath(this), applicationName));


            string redirectPath = checker.GetRedirectPath();

            Assert.AreEqual(String.Empty, redirectPath, "The redirect path should have returned String.Empty but it didn't.");
        }
コード例 #4
0
        public void Test_GetRedirectPath_Maintenance()
        {
            Uri url = new Uri("http://localhost/Test/Default.aspx");

            string applicationName = "TestApplication";

            string pathVariation = "testing";

            string appConfigPath = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Application." + pathVariation + ".config";

            string legacyDirectory = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Legacy";

            CreateMockLegacy(legacyDirectory);

            SetupChecker checker = new SetupChecker(url, applicationName);

            checker.Installer = new ApplicationInstaller(applicationName, pathVariation,
                                                         new MockFileMapper(this, TestUtilities.GetTestingPath(this), applicationName));

            checker.Restorer = new ApplicationRestorer(new MockFileMapper(this, TestUtilities.GetTestingPath(this), applicationName));
            checker.Restorer.LegacyDirectoryPath = legacyDirectory;

            string redirectPath = checker.GetRedirectPath();

            string expected = applicationName + "/Maintenance.html";

            Assert.AreEqual(expected.ToLower(), redirectPath.ToLower(), "The redirect path didn't return the expected value.");
        }
コード例 #5
0
        public void Test_GetRedirectPath_NoRedirect()
        {
            Uri url = new Uri("http://localhost/Test/Default.aspx");

            string applicationName = "TestApplication";

            string pathVariation = "testing";

            string appConfigPath = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Application." + pathVariation + ".config";

            CreateMockConfig(appConfigPath);

            SetupChecker checker = new SetupChecker(url, applicationName);
            checker.Installer = new ApplicationInstaller(applicationName, pathVariation);
            checker.FileMapper = new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName);

            checker.Restorer = new ApplicationRestorer(new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName));

            string redirectPath = checker.GetRedirectPath();

            Assert.AreEqual(String.Empty, redirectPath, "The redirect path should have returned String.Empty but it didn't.");
        }
コード例 #6
0
        public void Test_GetRedirectPath_Setup()
        {
            Uri url = new Uri("http://localhost/Test/Default.aspx");

            string applicationName = "TestApplication";

            string pathVariation = "testing";

            string appConfigPath = TestUtilities.GetTestDataPath(this, applicationName) + Path.DirectorySeparatorChar + "Application." + pathVariation + ".config";

            IFileMapper fileMapper = new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName);

            SetupChecker checker = new SetupChecker(url, applicationName, fileMapper);
            checker.Installer = new ApplicationInstaller(applicationName, pathVariation, fileMapper);
            //checker.Installer = new ApplicationInstaller(applicationName, pathVariation);
            //checker.Installer.FileMapper = new MockFileMapper(this,TestUtilities.GetTestingPath(this), applicationName);

            //checker.Restorer = new ApplicationRestorer();

            string redirectPath = checker.GetRedirectPath();

            string expected = applicationName + "/Admin/Setup.aspx";

            Assert.AreEqual(expected.ToLower(), redirectPath.ToLower(), "The redirect path didn't return the expected value.");
        }