Exemplo n.º 1
0
        public void Should_Create_Application_With_Predefined_EnabledProtocols()
        {
            // Arrange
            var websiteSettings = CakeHelper.GetWebsiteSettings("Batman");

            CakeHelper.CreateWebsite(websiteSettings);

            // Act
            var appSettings = CakeHelper.GetApplicationSettings(websiteSettings.Name);

            appSettings.AlternateEnabledProtocols = "http,net.pipe";

            WebsiteManager manager = CakeHelper.CreateWebsiteManager();
            var            added   = manager.AddApplication(appSettings);

            // Assert
            added.ShouldBeTrue();
            var application = CakeHelper.GetApplication(websiteSettings.Name, appSettings.ApplicationPath);

            application.ShouldNotBeNull();
            application.EnabledProtocols.ShouldContain(BindingProtocol.Http.ToString());
            application.EnabledProtocols.ShouldContain(BindingProtocol.NetPipe.ToString());

            CakeHelper.DeleteWebsite(websiteSettings.Name);
        }
Exemplo n.º 2
0
        public void Should_Create_Application_With_Predefined_EnabledProtocols()
        {
            // Arrange
            var websiteSettings = CakeHelper.GetWebsiteSettings();

            CakeHelper.DeleteWebsite(websiteSettings.Name);
            CakeHelper.CreateWebsite(websiteSettings);

            var appSettings = CakeHelper.GetApplicationSettings(websiteSettings.Name);

            appSettings.AlternateEnabledProtocols = "http,net.pipe";

            // Act
            WebsiteManager manager = CakeHelper.CreateWebsiteManager();
            var            added   = manager.AddApplication(appSettings);

            // Assert
            Assert.True(added);
            var application = CakeHelper.GetApplication(websiteSettings.Name, appSettings.ApplicationPath);

            Assert.NotNull(application);
            Assert.Contains(BindingProtocol.Http.ToString(),
                            application.EnabledProtocols,
                            StringComparison.OrdinalIgnoreCase);
            Assert.Contains(BindingProtocol.NetPipe.ToString(),
                            application.EnabledProtocols,
                            StringComparison.OrdinalIgnoreCase);
        }
Exemplo n.º 3
0
        public void Should_Create_Application()
        {
            // Arrange
            var websiteSettings = CakeHelper.GetWebsiteSettings();

            CakeHelper.DeleteWebsite(websiteSettings.Name);
            CakeHelper.CreateWebsite(websiteSettings);

            var appSettings = CakeHelper.GetApplicationSettings(websiteSettings.Name);

            // Act
            WebsiteManager manager = CakeHelper.CreateWebsiteManager();
            var            added   = manager.AddApplication(appSettings);

            // Assert
            Assert.True(added);
            Assert.NotNull(CakeHelper.GetApplication(websiteSettings.Name, appSettings.ApplicationPath));
        }
Exemplo n.º 4
0
        public void Should_Create_Application()
        {
            // Arrange
            var websiteSettings = CakeHelper.GetWebsiteSettings("Superman");

            CakeHelper.DeleteWebsite(websiteSettings.Name);

            // Act
            CakeHelper.CreateWebsite(websiteSettings);
            var appSettings = CakeHelper.GetApplicationSettings(websiteSettings.Name);

            WebsiteManager manager = CakeHelper.CreateWebsiteManager();
            var            added   = manager.AddApplication(appSettings);

            // Assert
            added.ShouldBeTrue();
            CakeHelper.GetApplication(websiteSettings.Name, appSettings.ApplicationPath).ShouldNotBeNull();

            CakeHelper.DeleteWebsite(websiteSettings.Name);
        }