예제 #1
0
        public void Can_delete_website()
        {
            WebsiteController websiteController = new WebsiteController(new Website { Name = "test_site", Server = "localhost" });

            websiteController.Delete();
            Assert.False(websiteController.Exists());
        }
예제 #2
0
        public void Can_tell_if_website_exists()
        {
            WebsiteController websiteController = new WebsiteController(new Website{Name = "test_site", Server = "localhost"});

            bool exist = websiteController.Exists();
            Assert.False(exist);
        }
예제 #3
0
        public void Website_exists_after_creating()
        {
            WebsiteController websiteController = new WebsiteController(new Website { Name = "test_site", Server = "localhost" });

            websiteController.Create();
            bool exist = websiteController.Exists();
            Assert.True(exist);
        }
예제 #4
0
        public void Dispose()
        {
            WebsiteController websiteController = new WebsiteController(new Website { Name = "test_site"});

            websiteController.Delete();

            Assert.False(websiteController.Exists());
        }
예제 #5
0
        public void Can_create_iis_website_given_name()
        {
            WebsiteController websiteController = new WebsiteController(new Website{Server = "localhost", Name = "test_site", Home = test_site, Port = 8888});

            int websiteId = websiteController.Create();
            Assert.True(websiteId > 0);

            string html = Helper.GetSite("http://localhost:8888/");

            Assert.Contains("Hello World", html);
        }