예제 #1
0
 public DiagnosticRequestHandler_Tests()
 {
     httpContext = new Mock<HttpContextBase>();
     response = new Mock<HttpResponseBase>();
     httpContext.SetupGet(c => c.Response).Returns(response.Object);
     var requestContext = new RequestContext(httpContext.Object, new RouteData());
     settings = new CassetteSettings();
     bundles = new BundleCollection(settings, Mock.Of<IFileSearchProvider>(), Mock.Of<IBundleFactoryProvider>());
     var urlGenerator = Mock.Of<IUrlGenerator>();
     rebuilder = new Mock<IBundleCacheRebuilder>();
     helper = new Mock<IBundlesHelper>();
     helper.Setup(h => h.Render<ScriptBundle>(null)).Returns(new HtmlString(""));
     helper.SetupGet(h => h.JsonSerializer).Returns(new SimpleJsonSerializer());
     Bundles.Helper = helper.Object;
     httpContext.SetupGet(c => c.Request.HttpMethod).Returns("GET");
     handler = new DiagnosticRequestHandler(requestContext, bundles, settings, urlGenerator, rebuilder.Object);
 }
예제 #2
0
        public DiagnosticRequestHandler_Tests()
        {
            httpContext = new Mock <HttpContextBase>();
            response    = new Mock <HttpResponseBase>();
            httpContext.SetupGet(c => c.Response).Returns(response.Object);
            var requestContext = new RequestContext(httpContext.Object, new RouteData());

            settings = new CassetteSettings();
            bundles  = new BundleCollection(settings, Mock.Of <IFileSearchProvider>(), Mock.Of <IBundleFactoryProvider>());
            var urlGenerator = Mock.Of <IUrlGenerator>();

            rebuilder = new Mock <IBundleCacheRebuilder>();
            helper    = new Mock <IBundlesHelper>();
            helper.Setup(h => h.Render <ScriptBundle>(null)).Returns(new HtmlString(""));
            helper.SetupGet(h => h.JsonSerializer).Returns(new SimpleJsonSerializer());
            Bundles.Helper = helper.Object;
            httpContext.SetupGet(c => c.Request.HttpMethod).Returns("GET");
            handler = new DiagnosticRequestHandler(requestContext, bundles, settings, urlGenerator, rebuilder.Object);
        }