Exemplo n.º 1
0
        public void Get(string url)
        {
            if (!url.StartsWith("/cassette.axd")) throw new ArgumentException("Must be a Cassette handler URL.", "url");

            if (url.Contains("?")) url = url.Substring(0, url.IndexOf('?'));

            var pathInfo = url.Substring("/cassette.axd".Length);

            Request.SetupGet(r => r.RequestType).Returns("GET");
            Request.SetupGet(r => r.HttpMethod).Returns("GET");
            Request.SetupGet(r => r.AppRelativeCurrentExecutionFilePath).Returns("~/cassette.axd");
            Request.SetupGet(r => r.PathInfo).Returns(pathInfo);

            host.StoreRequestContainerInHttpContextItems();
            var httpHandler = new CassetteHttpHandler(host.RequestContainer, Request.Object);
            httpHandler.ProcessRequest();
            ResponseOutputStream.Position = 0;
            host.RemoveRequestContainerFromHttpContextItems();
        }
Exemplo n.º 2
0
 public CassetteHttpHandler_Tests()
 {
     container = new TinyIoCContainer();
     request   = new Mock <HttpRequestBase>();
     handler   = new CassetteHttpHandler(container, request.Object);
 }
Exemplo n.º 3
0
 public CassetteHttpHandler_Tests()
 {
     container = new TinyIoCContainer();
     request = new Mock<HttpRequestBase>();
     handler = new CassetteHttpHandler(container, request.Object);
 }