public void should_delete_non_http_binding() { // Arrange string hostname = "helloworld.local"; string bindingInfo = "*:helloworld.local"; var serverConfig = new WebServerConfig(new LoggerStub()); serverConfig .AddSite(TestSiteName, 563, 4887) .AddNonHttpBinding(hostname, "net.pipe") .Commit(); // Act serverConfig .GetSite(TestSiteName) .DeleteNonHttpBinding(hostname, "net.pipe") .Commit(); // Assert var mgr = new ServerManager(); var site = mgr.Sites[TestSiteName]; Binding binding = site.Bindings.FirstOrDefault(x => x.BindingInformation == bindingInfo); Assert.That(binding, Is.Null); }
public void should_remove_virtual_directory() { // Arrange const string virtualDirectoryPhysicalPath = @"C:\temp\test"; const string iisPath = "/test"; var serverConfig = new WebServerConfig(new LoggerStub()); // Act serverConfig .AddSite(TestSiteName, 563, 8887) .AddVirtualDirectory(iisPath, virtualDirectoryPhysicalPath) .Commit(); serverConfig .GetSite(TestSiteName) .DeleteVirtualDirectory("/test") .Commit(); // Assert var mgr = new ServerManager(); var site = mgr.Sites[TestSiteName]; Assert.That(site.Applications[0].VirtualDirectories[iisPath], Is.Null); }
public void should_delete_binding() { // Arrange string hostname = "helloworld.local"; string bindingInfo = "*:4887:helloworld.local"; var serverConfig = new WebServerConfig(new LoggerStub()); serverConfig .AddSite(TestSiteName, 563, 4887) .AddBinding(4887, hostname, false) .Commit(); // Act serverConfig .GetSite(TestSiteName) .DeleteBinding(4887, hostname) .Commit(); // Assert var mgr = new ServerManager(); var site = mgr.Sites[TestSiteName]; Binding binding = site.Bindings.FirstOrDefault(x => x.BindingInformation == bindingInfo); Assert.That(binding, Is.Null); Assert.That(site.Bindings.ByProtocol("http").BindingInformation, Is.EqualTo("*:4887:")); }