Skip to content

Instantly share code, notes, and snippets.

[Collection("api")]
public class DryingReportTests
{
private static readonly string OutputPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\~DRTestOutput\";
private readonly TestContext _context;
public DryingReportTests(TestContext context)
=> _context = context;
[Fact(Skip = "Do not run in pipeline - test used for verification and actual PDF generation")]
using jsreport.AspNetCore;
using jsreport.Local;
public void ConfigureServices(IServiceCollection services)
{
//setup MVC because we need the server pdf rendering
services.AddMvc();
services.AddJsReport(new LocalReporting()
.UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ?
[HttpPost("commands/generate-drying-report")]
[MiddlewareFilter(typeof(JsReportPipeline))]
public async Task<IActionResult> GenerateDryingReport(Guid jobId, DryingReportTestScenarios isMock = 0)
{
if (jobId == Guid.Empty)
return BadRequest(nameof(jobId));
var dryingReport = isMock != DryingReportTestScenarios.UseJobId ? DryingReportGeneratedDtoMockData.GetMockForPreview(isMock) : await _mediator.Send(new GenerateDryingReport.Command(jobId));
//Render the Header.
@model Servpro.FranchiseSystems.Framework.Messaging.Events.Jobs.DryingReport.Models.DailyNarrativeDto
@if (Model?.DailyNarratives != null && Model.DailyNarratives.Count > 0)
{
<div class="floatLeft">
<p class="title">Daily Narrative</p>
<table class="daily-narrative-table" summary="Daily Narrative">
<tr>
<th scope="col" class="table-caption leftColumn">Timestamp</th>