Пример #1
0
        public void Blocks_Setup_Page_When_Already_Installed()
        {
            var browser = new BrowserBuilder().WithDefaultConfiguration().Build();
            var response = browser.Get("(/setup/1/", with => with.HttpRequest());

            Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode);
        }
Пример #2
0
        public void Can_Show_Setup_Page()
        {
            var browser = new BrowserBuilder().WithoutConfiguration().Build();
            var response = browser.Get("/setup/1/", with => with.HttpRequest());

            ServantAsserts.ResponseIsOkAndContainsData(response);
        }
Пример #3
0
        public void Redirects_To_Setup_Page_When_No_Config()
        {
            var browser = new BrowserBuilder().WithoutConfiguration().Build();
            var response = browser.Get("/", with => with.HttpRequest());

            response.ShouldHaveRedirectedTo("/setup/1/");
        }
Пример #4
0
        public void Can_Show_CreateSite_Page()
        {
            var browser = new BrowserBuilder().WithDefaultConfiguration().Build();
            var response = browser.Get("/sites/create", with =>
                {
                    with.Authenticated();
                    with.HttpRequest();
                });

            ServantAsserts.ResponseIsOkAndContainsData(response);
        }
Пример #5
0
        public void Cannot_Show_Home_Page_With_Wrong_Credentials()
        {
            var browser = new BrowserBuilder().WithDefaultConfiguration().Build();
            var response = browser.Get("/", with =>
            {
                with.BasicAuth("wronguser", "wrongpass");
                with.HttpRequest();
            });

            Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode);
        }
Пример #6
0
        public void Can_Show_Home_Page()
        {
            var browser = new BrowserBuilder().WithDefaultConfiguration().Build();
            var response = browser.Get("/", with =>
                {
                    with.Authenticated();
                    with.HttpRequest();
                });

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }
Пример #7
0
        public void Can_Show_Settings_Page()
        {
            var testSite = GetTestSiteFromIis();
            
            var browser = new BrowserBuilder().WithDefaultConfiguration().Build();
            var response = browser.Get("/sites/" + testSite.IisId + "/settings/", with =>
                {
                    with.HttpRequest(); 
                    with.Authenticated();
                });

            ServantAsserts.ResponseIsOkAndContainsData(response);
        }