Sha256: 6223f0c1543db1cc3d994dc6ae0c5abb4ce9cd731c23e81175e7d369c5af2f85

Contents?: true

Size: 1.71 KB

Versions: 3

Compression:

Stored size: 1.71 KB

Contents

using Xunit;

namespace DolphinDeploy.IIS.IIS6.Tests
{
    public class WebsiteControllerTests
    {
        private string test_site = "C:\\inetpub\\wwwroot\\test_site";

        [Fact]
        public void Can_get_if_website_exists()
        {
            WebsiteController websiteController = CreateController();

            bool exist = websiteController.Exists();
            Assert.False(exist);
        }

        [Fact]
        public void Can_create_iis_website_given_name()
        {
            WebsiteController websiteController = CreateController();
            int websiteId = websiteController.Create();
            Assert.True(websiteId > 0);
        }

        [Fact]
        public void Can_start_site()
        {
            WebsiteController websiteController = CreateController();
            websiteController.Create();
            websiteController.Start();
            string html = Helper.GetSite("http://localhost:8888/");

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

        [Fact]
        public void Can_delete_website()
        {
            WebsiteController websiteController = CreateController();
            websiteController.Delete();
            Assert.False(websiteController.Exists());
        }

        private WebsiteController CreateController()
        {
            var websiteController = new WebsiteController();
            websiteController.Server = "localhost";
            websiteController.Name = "test_site";
            websiteController.HomeDirectory = test_site;
            websiteController.Port = 8888;
            websiteController.AppPool = "DefaultAppPool";
            return websiteController;
        }
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dolphindeploy-0.0.3-universal-dotnet lib/csharp/DolphinDeploy.IIS.IIS6/DolphinDeploy.IIS.IIS6.Tests/WebsiteControllerTests.cs
dolphindeploy-0.0.2-universal-dotnet lib/csharp/DolphinDeploy.IIS.IIS6/DolphinDeploy.IIS.IIS6.Tests/WebsiteControllerTests.cs
dolphindeploy-0.0.1 lib/csharp/DolphinDeploy.IIS.IIS6/DolphinDeploy.IIS.IIS6.Tests/WebsiteControllerTests.cs