Restore legacy parity gaps lost in the VB.NET → C# migration
Close functional regressions found by comparing the legacy applications (Intranet_Legacy/) against their C# counterparts: - ProcessWebComService: send attachments inline (base64) with the push_com POST so invoice/reminder PDFs are attached again. - FuchsPdf: wire GetPaycode into ApplyInvoice/ApplyReminder to restore the SEPA giro-code payment QR, and restore the full standard invoice text block (§35a labor-cost note, Akonto text, §14/§48 notes, AGB, Steuernummer, Verrechnungssätze, etc.). - IntranetController: restore changepassword validation (password strength, confirmation match, current-password verification) and the mfr empty-id OData $metadata response. - Reports: port the ocms_visualization engine to C# (FuchsVisualization) and wire FuchsReports.ProcessFdsRequest to render generic/ generic_content/chart reports instead of returning an empty OK stub. Adds smoke tests for the giro QR generator and report page builder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using Fuchs.intranet;
|
||||
using Xunit;
|
||||
|
||||
namespace Fuchs.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Smoke tests for the non-DB parts of the restored report engine and the
|
||||
/// giro-code QR generator. The SQL-driven report rendering itself requires a
|
||||
/// live report catalog and is validated separately against the database.
|
||||
/// </summary>
|
||||
public class FuchsReportRenderTests
|
||||
{
|
||||
[Fact]
|
||||
public void GetPaycode_ProducesNonEmptyBitmap()
|
||||
{
|
||||
using var bmp = FuchsPdf.GetPaycode(
|
||||
iban: "DE52301502000002091478", bic: "WELADED1KSD",
|
||||
name: "Sebastian Fuchs Bad und Heizung", amount: 123.45m, purpose: "Rechnung 4711");
|
||||
Assert.NotNull(bmp);
|
||||
Assert.True(bmp.Width > 0);
|
||||
Assert.True(bmp.Height > 0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HtmlPage_Web_FallbackShell_EmbedsContentTitleAndReload()
|
||||
{
|
||||
var page = new FuchsHtmlPage("My Report", templatePath: "", queryDuration: 0)
|
||||
{
|
||||
ReloadSeconds = 60
|
||||
};
|
||||
page.Add("<div id=\"frm\">hello</div>");
|
||||
|
||||
string html = page.ToHtml(FdsDestination.web);
|
||||
|
||||
Assert.Contains("hello", html);
|
||||
Assert.Contains("My Report", html); // title injected
|
||||
Assert.Contains("http-equiv=\"refresh\"", html); // reload meta injected
|
||||
Assert.Contains("content=\"60\"", html);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HtmlPage_Content_OmitsReloadAndTitleChrome()
|
||||
{
|
||||
var page = new FuchsHtmlPage("Ignored", templatePath: "");
|
||||
page.Add("<span>fragment</span>");
|
||||
|
||||
string html = page.ToHtml(FdsDestination.content);
|
||||
|
||||
Assert.Contains("fragment", html);
|
||||
Assert.DoesNotContain("http-equiv=\"refresh\"", html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user