Exemplo n.º 1
0
        public void SetDefaultErrorPage()
        {
            var published = Context.Application.GetPublished();
            var x         = new ErrorPages(published);
            var page      = new MyPage();

            x.SetDefaultPage(HttpStatusCode.ExpectationFailed, () => page);
            var result = x.GetPage(HttpStatusCode.ExpectationFailed);
            var show   = result.CreateInstance();

            Assert.Same(page, show);

            x.Remove(HttpStatusCode.ExpectationFailed);
            result = x.GetPage(HttpStatusCode.ExpectationFailed);
            Assert.Null(result);
        }
Exemplo n.º 2
0
        public void DefaultNotFoundRuns()
        {
            var pages = new ErrorPages(Context.Application.GetPublished());
            var page  = pages.GetPage(System.Net.HttpStatusCode.NotFound);

            Assert.NotNull(page);
        }