QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142) getrackt, ohne .gitmodules und ohne erreichbares Remote. Der Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen. Umstellung: - Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6) - Gitlink aus dem Index entfernt - Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
94 lines
4.1 KiB
C#
94 lines
4.1 KiB
C#
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.WebServices.ReportEngine;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using FastReport.Export.Pdf;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.ReportEngine
|
|
{
|
|
/// <summary>
|
|
/// End-to-end tests for PDF export settings API.
|
|
/// Validates both standard and PDF-A/3 export profiles with their properties.
|
|
/// </summary>
|
|
public class PdfExportSettingsTests : EndToEndTest
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="PdfExportSettingsTests"/> class.
|
|
/// </summary>
|
|
/// <param name="testOutputHelper">The test output helper.</param>
|
|
public PdfExportSettingsTests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
// Uncomment to update expected files during test development
|
|
// Verifier.OverrideExpectedFiles = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The main test execution entry point.
|
|
/// </summary>
|
|
public override void Execute()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
// Test the PDF export settings API
|
|
TestGetAndSavePdfExportSettings(session);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests getting and saving PDF export settings through the WebServiceBL.
|
|
/// </summary>
|
|
/// <param name="session">The BLSession instance.</param>
|
|
private void TestGetAndSavePdfExportSettings(BLSession session)
|
|
{
|
|
// Get the initial settings
|
|
var webServiceBL = session.GetBL<PdfExportSettingsWebServiceBL>();
|
|
var initialSettings = webServiceBL.GetPdfExportSettings();
|
|
|
|
// Verify the result is successful
|
|
Assert.True(initialSettings.Status == ResultStatus.Success);
|
|
Assert.NotNull(initialSettings.Data);
|
|
|
|
// Verify the initial settings values
|
|
Verifier.Verify("PdfExportSettings_Initial", initialSettings.Data);
|
|
|
|
// Modify settings with test values
|
|
var modifiedSettings = initialSettings.Data;
|
|
|
|
// Standard profile settings
|
|
modifiedSettings.StandardEmbeddingFonts = !modifiedSettings.StandardEmbeddingFonts;
|
|
modifiedSettings.StandardCompliance = (int)PDFExport.PdfStandard.PdfA_3b;
|
|
modifiedSettings.StandardColorSpace = (int)PDFExport.PdfColorSpace.CMYK;
|
|
modifiedSettings.StandardJpegCompression = !modifiedSettings.StandardJpegCompression;
|
|
modifiedSettings.StandardCompression = !modifiedSettings.StandardCompression;
|
|
modifiedSettings.StandardTransparentImages = !modifiedSettings.StandardTransparentImages;
|
|
modifiedSettings.StandardPrintOptimized = !modifiedSettings.StandardPrintOptimized;
|
|
|
|
// PDF-A/3 profile settings - these should be modified but preserved when applied
|
|
modifiedSettings.PdfA3JpegCompression = !modifiedSettings.PdfA3JpegCompression;
|
|
modifiedSettings.PdfA3Compression = !modifiedSettings.PdfA3Compression;
|
|
modifiedSettings.PdfA3TransparentImages = !modifiedSettings.PdfA3TransparentImages;
|
|
modifiedSettings.PdfA3PrintOptimized = !modifiedSettings.PdfA3PrintOptimized;
|
|
modifiedSettings.PdfA3ColorSpace = (int)PDFExport.PdfColorSpace.CMYK;
|
|
|
|
// Save the modified settings
|
|
var saveResult = webServiceBL.SavePdfExportSettings(modifiedSettings);
|
|
|
|
// Verify the save was successful
|
|
Assert.True(saveResult.Status == ResultStatus.Success);
|
|
|
|
// Retrieve the settings again to verify they were saved correctly
|
|
var retrievedSettings = webServiceBL.GetPdfExportSettings();
|
|
|
|
// Verify the settings were updated correctly
|
|
Verifier.Verify("PdfExportSettings_Modified", retrievedSettings);
|
|
|
|
// Restore the original settings
|
|
webServiceBL.SavePdfExportSettings(initialSettings.Data);
|
|
}
|
|
|
|
}
|
|
}
|