コード例 #1
0
        public async Task get_raw_index_html_with_document_title()
        {
            var indexHtmlLoader = new IndexHtmlLoader();

            var rawIndexHtml = await indexHtmlLoader.LoadRawWith(ADocumentTitle, ARootUrl, AUrlPath);

            rawIndexHtml.Contains($"<title>{ADocumentTitle}</title>").Should().BeTrue();
        }
コード例 #2
0
        public BacklightMiddleware(RequestDelegate next, MiddlewareConfiguration configuration, IndexHtmlLoader idexHtmlLoader, IWebHostEnvironment webHostEnvironment, ILoggerFactory loggerFactory)
        {
            this.configuration  = configuration;
            this.idexHtmlLoader = idexHtmlLoader;
            var staticFileOptions = StaticFileOptionsFrom(new UIStaticFilesProvider());

            staticFilesMiddleware = new StaticFileMiddleware(next, webHostEnvironment, staticFileOptions, loggerFactory);
        }
コード例 #3
0
 public void SetUp()
 {
     next                      = Substitute.For <RequestDelegate>();
     configuration             = new MiddlewareConfiguration();
     indexHtmlLoader           = Substitute.For <IndexHtmlLoader>();
     loggerFactory             = Substitute.For <ILoggerFactory>();
     webHostEnvironment        = Substitute.For <IWebHostEnvironment>();
     middleware                = new BacklightMiddleware(next, configuration, indexHtmlLoader, webHostEnvironment, loggerFactory);
     httpContext               = new DefaultHttpContext();
     httpContext.Response.Body = new MemoryStream();
 }