コード例 #1
0
ファイル: HttpFactoryTests.cs プロジェクト: knocte/HttpMock
        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);
        }
コード例 #2
0
 public static IHttpServer At(Uri uri)
 {
     return(_httpServerFactory.Get(uri).WithNewContext(uri.AbsolutePath));
 }
コード例 #3
0
 public static IHttpServer At(Uri uri)
 {
     return(_httpServerFactory.Get(uri).WithNewContext(Guid.Empty));
 }