Files
Masterarbeit/QuellCode/CentronERP/tests/Centron.Tests.EndToEnd/TicketTests/Ticket137112/Ticket137112Tests.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

88 lines
3.1 KiB
C#

using System.Collections.Generic;
using System.Linq;
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
using Centron.BusinessLogic.WebServices.Sales.Receipts;
using Centron.Data.WebServices.Sales.Receipts.Orders;
using Centron.Interfaces;
using Centron.Interfaces.BL;
using Centron.Interfaces.Sales.Receipts;
using Centron.Interfaces.Sales.Receipts.InsertReceipts;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.EntitiesWrongPlace.Sales.Receipts.DataAndResults;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.TicketTests.Ticket137112;
public class Ticket137112Tests : EndToEndTest
{
public Ticket137112Tests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
private const int Offer1I3D = 161;
private const int Offer2I3D = 223;
public override void Execute()
{
// In this ticket the problem was, when you forwarded multiple source receipts into one destination receipt
// And multiple of those multiple source receipts had a CustomerDiscount position
// Then you would have multiple CustomerDiscount positions in the destination receipt
// And then the position-grid would be quite weird
var order = this.ForwardOffersToOrder();
var customerDiscountItems = order.Items
.Where(f => f.Kind == ReceiptItemKind.CustomerDiscount)
.ToList();
Assert.Single(customerDiscountItems);
this.Verifier.Verify("CustomerDiscountItem", customerDiscountItems[0]);
}
private ReceiptOrderDTO ForwardOffersToOrder()
{
var newOrder = this.WithSession(s => s.GetBL<ReceiptWebServiceBL>().ForwardReceipt(
CentronObjectKindNumeric.OrderClass,
this.GetLoggedInUser().User,
new ForwardReceiptData
{
IgnoreCallbacks = true,
CreateReceiptData = new CreateReceiptData
{
IgnoreCallbacks = true,
},
CreateReceiptItemsFromExistingItemsData = new List<CreateReceiptItemsFromExistingItemsData>
{
new()
{
IgnoreCallbacks = true,
},
new()
{
IgnoreCallbacks = true,
},
},
},
new List<ReceiptToForward>
{
new()
{
ReceiptKind = CentronObjectKindNumeric.OfferClass,
ReceiptI3D = Offer1I3D,
},
new()
{
ReceiptKind = CentronObjectKindNumeric.OfferClass,
ReceiptI3D = Offer2I3D,
}
},
receiptProjectLayoutItemI3DsToForward: null,
InsertReceiptTakeoverOptions.Reference,
onlyTakeoverAvailableQuantity: false,
ignoreDefaultContract: true)).ThrowIfError();
return (ReceiptOrderDTO)newOrder.Receipt;
}
}