Exemplo n.º 1
0
        public void ShouldBeAbleToHostAtSameAddressIfPreviousWasDisposed()
        {
            var serverFactory = new HttpServerFactory();

            var uri = new Uri(String.Format("http://localhost:{0}", PortHelper.FindLocalAvailablePortForTesting()));
            var server = serverFactory.Get(uri).WithNewContext(uri.AbsoluteUri);
            server.Start();
            server.Dispose();

            var httpServer2 = serverFactory.Get(uri).WithNewContext(uri.AbsoluteUri);
            Assert.DoesNotThrow(httpServer2.Start);
        }
Exemplo n.º 2
0
 public static IHttpServer At(Uri uri)
 {
     return(_httpServerFactory.Get(uri).WithNewContext(uri.AbsolutePath));
 }
Exemplo n.º 3
0
 public static IHttpServer At(Uri uri)
 {
     return(_httpServerFactory.Get(uri).WithNewContext(Guid.Empty));
 }