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(); }
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); }
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(); }