public void Login_WithPageId_VerifyLoginRedirectUrlIsCorrect() { var pageOperations = new PagesOperations(); try { string loginStatusPageUrl = UrlPath.ResolveAbsoluteUrl("~/" + this.urlNamePrefix + this.pageIndex); var basicPageOperations = new Telerik.Sitefinity.TestUtilities.CommonOperations.PagesOperations(); var pageTitle = "Page Title1"; var pageUrl = "PageTitle1"; var absoluteUrl = UrlPath.GetDomainUrl() + "/" + pageUrl; try { var loginPageId = basicPageOperations.CreatePage(pageTitle, pageUrl); var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(LoginStatusController).FullName; var loginStatusController = new LoginStatusController(); loginStatusController.Model.LoginPageId = loginPageId; mvcProxy.Settings = new ControllerSettings(loginStatusController); pageOperations.CreatePageWithControl(mvcProxy, this.pageNamePrefix, this.pageTitlePrefix, this.urlNamePrefix, this.pageIndex); var responseContent = PageInvoker.ExecuteWebRequest(loginStatusPageUrl); Assert.IsTrue(responseContent.Contains(this.GetExpectedUrlWithParams(absoluteUrl)), "Login redirect url is not as expected"); } finally { basicPageOperations.DeleteAllPages(); } } finally { pageOperations.DeletePages(); } }
public void Logout_WithPageIdAndRedirectUrl_VerifyLogoutRedirectUrlIsCorrect() { string expectedLogoutUrl = "www.telerik.com"; string logoutStatusPageUrl = UrlPath.ResolveAbsoluteUrl("~/" + this.urlNamePrefix + this.pageIndex); var basicPageOperations = new Telerik.Sitefinity.TestUtilities.CommonOperations.PagesOperations(); var pageTitle = "Page Title1"; var pageUrl = "PageTitle1"; try { var logoutPageId = basicPageOperations.CreatePage(pageTitle, pageUrl); var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(LoginStatusController).FullName; var loginStatusController = new LoginStatusController(); loginStatusController.Model.LogoutPageId = logoutPageId; loginStatusController.Model.ExternalLogoutUrl = expectedLogoutUrl; mvcProxy.Settings = new ControllerSettings(loginStatusController); this.pageOperations.CreatePageWithControl(mvcProxy, this.pageNamePrefix, this.pageTitlePrefix, this.urlNamePrefix, this.pageIndex); var responseContent = PageInvoker.ExecuteWebRequest(logoutStatusPageUrl); Assert.IsTrue(responseContent.Contains(expectedLogoutUrl), "Logout redirect url is not as expected"); } finally { basicPageOperations.DeleteAllPages(); } }
public void Login_WithPageId_VerifyLoginRedirectUrlIsCorrect() { string loginStatusPageUrl = UrlPath.ResolveAbsoluteUrl("~/" + this.urlNamePrefix + this.pageIndex); var basicPageOperations = new Telerik.Sitefinity.TestUtilities.CommonOperations.PagesOperations(); var pageTitle = "Page Title1"; var pageUrl = "PageTitle1"; var absoluteUrl = UrlPath.GetDomainUrl() + "/" + pageUrl; try { var loginPageId = basicPageOperations.CreatePage(pageTitle, pageUrl); var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(LoginStatusController).FullName; var loginStatusController = new LoginStatusController(); loginStatusController.Model.LoginPageId = loginPageId; mvcProxy.Settings = new ControllerSettings(loginStatusController); this.pageOperations.CreatePageWithControl(mvcProxy, this.pageNamePrefix, this.pageTitlePrefix, this.urlNamePrefix, this.pageIndex); var responseContent = PageInvoker.ExecuteWebRequest(loginStatusPageUrl); Assert.IsTrue(responseContent.Contains(this.GetExpectedUrlWithParams(absoluteUrl)), "Login redirect url is not as expected"); } finally { basicPageOperations.DeleteAllPages(); } }
public void Logout_WithPageIdAndRedirectUrl_VerifyLogoutRedirectUrlIsCorrect() { var pageOperations = new PagesOperations(); try { string expectedLogoutUrl = "www.telerik.com"; string logoutStatusPageUrl = UrlPath.ResolveAbsoluteUrl("~/" + this.urlNamePrefix + this.pageIndex); var basicPageOperations = new Telerik.Sitefinity.TestUtilities.CommonOperations.PagesOperations(); var pageTitle = "Page Title1"; var pageUrl = "PageTitle1"; try { var logoutPageId = basicPageOperations.CreatePage(pageTitle, pageUrl); var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(LoginStatusController).FullName; var loginStatusController = new LoginStatusController(); loginStatusController.Model.LogoutPageId = logoutPageId; loginStatusController.Model.ExternalLogoutUrl = expectedLogoutUrl; mvcProxy.Settings = new ControllerSettings(loginStatusController); pageOperations.CreatePageWithControl(mvcProxy, this.pageNamePrefix, this.pageTitlePrefix, this.urlNamePrefix, this.pageIndex); var responseContent = PageInvoker.ExecuteWebRequest(logoutStatusPageUrl); Assert.IsTrue(responseContent.Contains(expectedLogoutUrl), "Logout redirect url is not as expected"); } finally { basicPageOperations.DeleteAllPages(); } } finally { pageOperations.DeletePages(); } }