public TestHttpServer(FixedPortAddress address, IHttpHandler handler)
        {
            Url = address.Url;
            this.handler = handler;

            Instance = this;
        }
Пример #2
0
        public HttpServer(FixedPortAddress address, IHttpHandler handler)
        {
            Contract.Requires(handler != null);

            this.address = address;
            this.handler = handler;
            listener = new HttpListener();
        }
Пример #3
0
        public void SendPut(
            FixedPortAddress address,
            Action<Stream> toPerformOnRequest,
            Action<Stream> toPerformOnResponse,
            Action<Exception> toPerformOnError,
            Action toPerformOnCompletion)
        {
            Log(address);

            PutSender.Send(toPerformOnRequest, toPerformOnResponse, toPerformOnError, toPerformOnCompletion, address.Url);
        }
Пример #4
0
 public void SendPut(FixedPortAddress address, Action<Stream> toPerformOnRequest)
 {
     Log(address);
     SendPut(address, toPerformOnRequest, s => { }, _ => { }, () => { });
 }
Пример #5
0
 static void Log(FixedPortAddress address)
 {
     Logger.Debug("Sending put to {0}", address);
 }
 public IHttpServer Build(FixedPortAddress address, IHttpHandler handler)
 {
     return new TestHttpServer(address, handler);
 }