Exemplo n.º 1
0
        public void AbortUrlTriggersContentTypeSet()
        {
            var request = new Mock <IRequest>();
            var qs      = new NameValueCollection();

            request.Setup(m => m.QueryString).Returns(new NameValueCollectionWrapper(qs));
            request.Setup(m => m.LocalPath).Returns("/test/echo/abort");
            var response            = new Mock <IResponse>();
            var counters            = new Mock <IPerformanceCounterManager>();
            var heartBeat           = new Mock <ITransportHeartbeat>();
            var hostContext         = new HostContext(request.Object, response.Object);
            var transportConnection = new Mock <ITransportConnection>();
            var traceManager        = new Mock <ITraceManager>();
            var transport           = new WebSocketTransport(hostContext, null, heartBeat.Object, counters.Object, traceManager.Object, null, null);

            transport.ProcessRequest(transportConnection.Object).Wait();
            response.VerifySet(r => r.ContentType = It.IsAny <string>(), "ContentType not set");
        }