Ejemplo n.º 1
0
        public UWebEngine(IRouteCollection collection, IRequestGraph requestGraph, IServiceContainer serviceContainer, IPrePipelineCollection prePipelineCollection, 
            IPostPipelineCollection postPipelineCollection)
        {
            collection.ArgumentNullCheck("collection");
            requestGraph.ArgumentNullCheck("requestGraph");
            serviceContainer.ArgumentNullCheck("serviceContainer");
            prePipelineCollection.ArgumentNullCheck("prePipelineCollection");
            postPipelineCollection.ArgumentNullCheck("postPipelineCollection");

            this.collection = collection;
            this.requestGraph = requestGraph;
            this.serviceContainer = serviceContainer;
            this.prePipelineCollection = prePipelineCollection;
            this.postPipelineCollection = postPipelineCollection;
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            routeCollection = A.Fake<IRouteCollection>();
            outputWriter = A.Fake<IOutputWriter>();
            requestGraph = A.Fake<IRequestGraph>();
            prePipelineCollection = A.Fake<IPrePipelineCollection>();
            postPipelineCollection = A.Fake<IPostPipelineCollection>();

            endpoint = A.Fake<IEndpoint>();
            request = A.Fake<IRequest>();
            route = A.Fake<IRoute>();
            requestChain = A.Fake<IRequestChain>();
            response = A.Fake<IResponse>();

            serviceContainer = A.Fake<IServiceContainer>();

            A.CallTo(() => route.Endpoint).Returns(endpoint);
            A.CallTo(() => routeCollection.Resolve(request)).Returns(route);
            A.CallTo(() => requestGraph.FindChainFor(endpoint)).Returns(requestChain);
            A.CallTo(() => outputWriter.CreateResponse()).Returns(response);

            engine = new UWebEngine(routeCollection, requestGraph, serviceContainer, prePipelineCollection, postPipelineCollection);
        }