From 9aa1fee49e402026e592576f107f6891cd5131f7 Mon Sep 17 00:00:00 2001 From: troogs Date: Fri, 3 Apr 2026 12:33:48 +0200 Subject: [PATCH] Add unit tests for DashboardPdfStatementService to validate PDF generation with entries and transfers --- .vscode/launch.json | 2 +- src/Duempelkas.App/Pages/Dashboard.razor | 57 +++++ .../Services/IPdfStatementService.cs | 1 + src/Duempelkas.Desktop/Assets/app-icon.ico | Bin 0 -> 87082 bytes src/Duempelkas.Desktop/Assets/app-icon.png | Bin 0 -> 68226 bytes .../Duempelkas.Desktop.csproj | 4 + src/Duempelkas.Desktop/Program.cs | 42 +++- .../Services/PdfStatementService.cs | 213 ++++++++++++++++++ .../DashboardPdfStatementServiceTests.cs | 132 +++++++++++ 9 files changed, 448 insertions(+), 3 deletions(-) create mode 100644 src/Duempelkas.Desktop/Assets/app-icon.ico create mode 100644 src/Duempelkas.Desktop/Assets/app-icon.png create mode 100644 tests/Duempelkas.Tests/DashboardPdfStatementServiceTests.cs diff --git a/.vscode/launch.json b/.vscode/launch.json index 712bc83..329ea7b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/Duempelkas.Desktop/bin/Debug/net10.0/Duempelkas.Desktop.dll", + "program": "${workspaceFolder}/src/Duempelkas.Desktop/bin/Debug/net10.0/Duempelkas.Desktop.exe", "args": [], "cwd": "${workspaceFolder}/src/Duempelkas.Desktop", "stopAtEntry": false, diff --git a/src/Duempelkas.App/Pages/Dashboard.razor b/src/Duempelkas.App/Pages/Dashboard.razor index 8a40306..2358eca 100644 --- a/src/Duempelkas.App/Pages/Dashboard.razor +++ b/src/Duempelkas.App/Pages/Dashboard.razor @@ -2,8 +2,11 @@ @inject IAccountService AccountService @inject IBackupService BackupService @inject ISettingsService SettingsService +@inject IPdfStatementService PdfStatementService +@inject IFileSaveService FileSaveService @inject IJSRuntime JsRuntime @inject NavigationManager NavigationManager +@using System.Globalization
@@ -29,8 +32,22 @@ + | +
+ @if (accounts != null && accounts.Any()) + { +
+ Summe aller Konten: + + @FormatCurrency(TotalClubBalance) + +
+ } + @if (!string.IsNullOrWhiteSpace(operationMessage)) {