Files
Masterarbeit/QuellCode/CentronERP/tests/Centron.Tests.EndToEnd/TicketTests/Ticket111051/Ticket11051Test.cs
T
Christoph Schwörer f045b99a25 Codebasis als Dateien ins Arbeitsrepo statt als Gitlink
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
2026-08-26 07:43:51 +02:00

68 lines
2.6 KiB
C#

using System;
using System.Linq;
using Centron.BusinessLogic.Administration.Masterdata;
using Centron.BusinessLogic.Sales.Receipts;
using Centron.BusinessLogic.Sales.Receipts.Internal;
using Centron.DAO;
using Centron.Data.Entities.Sales.Receipts.Invoices;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.TicketTests.Ticket111051
{
public class Ticket11051Test : EndToEndTest
{
public Ticket11051Test(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
this.PrepareDatabase();
this.CreateConditionText("Mandat1", mandatI3D: 1);
this.CreateConditionText("Mandat2", mandatI3D: 2);
}
private void CreateConditionText(string name, int mandatI3D)
{
using (var session = new DAOSession())
{
session.StartTransaction();
try
{
// Load receipt, mandats and condition-text
var receipt = new ReceiptBL(session).GetReceiptByI3D<ReceiptInvoice>(4396);
var allMandats = new ReceiptBL(session).GetReceiptMandats(receipt.CustomerI3D);
var text = new AssetConditionBL(session).GetAssetConditionText(receipt.PaymentConditionI3D.Value, receipt.CountryI3D.GetValueOrDefault(0));
text.Text = "@PI @PBN @PBB @PM"; // Update condition-text to include the mandat-variables
var mandat = allMandats.FirstOrDefault(f => f.I3D == mandatI3D);
if (mandat == null)
throw new Exception($"The mandat with I3D {mandatI3D} was not found.");
// Change the mandat on the receipt
receipt.MandatI3D = mandat.I3D;
// Get the replaced text
var replacedText = new AssetConditionTextReplacementBL(session).ReplaceAssetConditionText(text, receipt);
this.Verifier.Verify(name, replacedText);
}
finally
{
// Rollback everything at the end so we don't save anything to the database
session.RollbackTransaction();
}
}
}
private void PrepareDatabase()
{
this.Sql(@"INSERT INTO dbo.Bankverbindungen (Status, BankName, IBAN, ObjectI3D, ObjectArt, BIC, AuthorizationNumber)
VALUES(1, 'Test-Bank', 'DE0123456789', 10000, 0, 'CETESTBIC', '123456')");
}
}
}