Exemple #1
0
        public void NotFoundViewTestIncludeMessage()
        {
            var message = "testpage.html";
            var view    = new NotFoundView(message);

            Assert.IsTrue(view.Content.Contains(message), $"in NotFound.Content: {view.Content} does not contains {message}");
        }
Exemple #2
0
        protected override void OnInit(EventArgs e)
        {
            string culture = Request.QueryString["culture"];

            if (!string.IsNullOrEmpty(culture))
            {
                Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
            }
            string uiCulture = Request.QueryString["uiculture"];

            if (!string.IsNullOrEmpty(uiCulture))
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(uiCulture);
            }

            base.OnInit(e);

            if (!IsPostBack)
            {
                List <int> invalidRowIds;
                if (UrlTrackerRepository.HasInvalidEntries(out invalidRowIds))
                {
                    ltlError.Text          = string.Format(UrlTrackerResources.ErrorMessageOldUrlAndOldRegexEmpty, string.Join(", ", invalidRowIds));
                    lbDeleteErrorRows.Text = UrlTrackerResources.ErrorMessageOldUrlAndOldRegexEmptyButton;
                    mvUrlTrackerError.SetActiveView(vwUrlTrackerErrorMessage);
                    odsUrlTrackerEntries.Selecting += odsUrlTrackerEntries_Selecting;
                }

                gvUrlTracker.Sort("Inserted", SortDirection.Descending);
                gvNotFound.Sort("NotFoundCount", SortDirection.Descending);
            }

            if (!_earlyErrorDetected)
            {
                pnlBreadcrumb.Visible = false;

                if (icAutoView == null)
                {
                    icAutoView     = (AutoView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.AutoView.ascx");
                    icCustomView   = (CustomView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.CustomView.ascx");
                    icNotFoundView = (NotFoundView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.NotFoundView.ascx");
                    icAdvancedView = (AdvancedView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.AdvancedView.ascx");
                    icCreateView   = (CreateView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.CreateView.ascx");

                    pnlEditValidationGroup.Controls.AddAt(0, icAutoView);
                    pnlEditValidationGroup.Controls.AddAt(1, icCustomView);
                    pnlEditValidationGroup.Controls.AddAt(2, icNotFoundView);
                    pnlEditValidationGroup.Controls.AddAt(3, icAdvancedView);
                    pnlCreateValidationGroup.Controls.AddAt(0, icCreateView);
                }
            }
        }
Exemple #3
0
        public void NotFoundViewStatusCode()
        {
            var view = new NotFoundView();

            Assert.AreEqual(view.StatusCode, 404);
        }