Files
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

54 lines
2.0 KiB
C#

using Centron.BusinessLogic;
using Centron.BusinessLogic.WebServices.Accounts;
using Centron.BusinessLogic.WebServices.Accounts.SpecialPrices;
using Centron.Interfaces.Accounts;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.AccountArticleSpecialPrices.CopyToChildCompanyGroups;
public class CopyToChildCompanyGroupTests : EndToEndTest
{
public CopyToChildCompanyGroupTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
this.Verifier.Settings.IgnoreColumn("Erstelldatum");
}
private const int ParentAccountI3D = 19;
private const int ParentCustomerNumber = 10020;
private const int ChildAccountI3D = 1025;
private const int ChildCustomerNumber = 10026;
public override void Execute()
{
this.PrepareDatabase();
this.CopySpecialPrices();
}
private void PrepareDatabase()
{
var filter = new AccountFilter()
{
AccountI3D = ChildAccountI3D
};
var account = this.WithSession(f => f.GetBL<AccountWebServiceBL>().GetAccount(this.GetLoggedInUser(), filter, mixMode: false)).ThrowIfError();
account.CompanyGroupI3D = ParentAccountI3D;
this.WithSession(f => f.GetBL<AccountWebServiceBL>().SaveAccount(this.GetLoggedInUser(), account, mixMode: false, isDataImport: false)).ThrowIfError();
}
private void CopySpecialPrices()
{
using var session = new BLSession();
var copyResult = session.GetBL<AccountSpecialPriceWebServiceBL>().CopyAccountSpecialPricesToCompanyGroupChilds(ParentCustomerNumber, this.GetLoggedInUser());
this.Verifier.Verify("CopyResult", copyResult);
this.Verifier.VerifySql("ParentSpecialPrices", $"SELECT * FROM KundenSonderpreise WHERE KundenI3D = {ParentCustomerNumber}");
this.Verifier.VerifySql("ChildSpecialPrices", $"SELECT * FROM KundenSonderpreise WHERE KundenI3D = {ChildCustomerNumber}");
}
}