Files
Masterarbeit/QuellCode/CentronERP/tests/Centron.Tests.EndToEnd/Tests/CopyReceipt/CopyReceiptTests.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

61 lines
2.2 KiB
C#

using Centron.BusinessLogic;
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
using Centron.BusinessLogic.WebServices.Sales.Receipts;
using Centron.Interfaces;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.EntitiesWrongPlace.Sales.Receipts.DataAndResults;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.CopyReceipt;
public class CopyReceiptTests : EndToEndTest
{
public CopyReceiptTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
private const int OfferI3D = 6643;
private const int NewCustomerI3D = 10020;
public override void Execute()
{
this.PrepareDatabase();
this.ExecuteMatrix(new [] { true, false }, (takeoverPrice) =>
{
using var session = new BLSession();
var copy = session.GetBL<ReceiptWebServiceBL>().CopyReceipt(
CentronObjectKindNumeric.OfferClass,
this.GetLoggedInUser().User,
new CopyReceiptData
{
IgnoreCallbacks = true,
TakeoverOption = takeoverPrice ? ReceiptItemTakeoverOption.TakeoverArticlePrice : ReceiptItemTakeoverOption.None,
CreateReceiptData = new CreateReceiptData
{
IgnoreCallbacks = true,
},
CreateReceiptItemsFromExistingItemsData = new CreateReceiptItemsFromExistingItemsData
{
IgnoreCallbacks = true,
},
},
OfferI3D,
NewCustomerI3D,
addressI3D: null,
contactPersonI3D: null).ThrowIfError();
this.Verifier.Verify($"CopyReceipt_TakeoverPrice_{takeoverPrice}", copy.Receipt);
});
}
private void PrepareDatabase()
{
// Set the price to 100, so in the case where we don't takeover the price, we get the freshly calculated one
this.Sql($"UPDATE dbo.AngPos SET VKBasisWert = 100 WHERE AngKopfI3D = {OfferI3D} AND VKKalk IS NOT NULL");
}
}