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

65 lines
2.7 KiB
C#

using System.Collections.Generic;
using System.Linq;
using Centron.BusinessLogic;
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.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.Ticket120182
{
public class Ticket120182Tests : EndToEndTest
{
public Ticket120182Tests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
// In the database are many receipt-items, that have a IReceiptItemWithBalanceItem.BalanceId of string.Empty
// There is a bug in the ReceiptItemBL.CreateReceiptItemsFromExistingItems
// It would see the that the BalanceId is not NULL, assume it's a real legal value, and connect the positions with new BalanceIds together
const int ReceiptItemI3D1 = 488;
const int ReceiptItemI3D2 = 489;
const int ReceiptItemI3D3 = 491;
using var session = new BLSession();
var newOffer = session.GetBL<ReceiptWebServiceBL>().CreateNewReceipt(
CentronObjectKindNumeric.OrderClass,
GetLoggedInUser(),
10003,
new CreateReceiptData { IgnoreCallbacks = true },
addressI3D: null,
contactPersonI3D: null,
insertSalutationAndAgreement: false,
ignoreDefaultContract: false,
insertCustomerDiscount: false);
var copiedReceiptItemsResult = session.GetBL<ReceiptItemWebServiceBL>().CreateReceiptItemsFromExistingItems(
newOffer.Data.Receipt,
this.GetLoggedInUser().User,
CentronObjectKindNumeric.InvoiceClass,
new List<int> { ReceiptItemI3D1, ReceiptItemI3D2, ReceiptItemI3D3 },
InsertReceiptTakeoverOptions.Copy,
takeoverPrice: true,
takeoverPurchasePrice: true,
takeoverCostCenterCostObject: true,
onlyTakeoverAvailableQuantity: false,
new CreateReceiptItemsFromExistingItemsData { IgnoreCallbacks = true },
doNotInsertFreeTexts: true);
var receiptItems = copiedReceiptItemsResult.Data.ReceiptItems.Cast<ReceiptOrderItemDTO>().ToList();
Assert.All(receiptItems, f =>
{
Assert.Null(f.BalanceID);
});
}
}
}