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
96 lines
3.5 KiB
C#
96 lines
3.5 KiB
C#
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.WebServices.Administration.Company;
|
|
using Centron.BusinessLogic.WebServices.Administration.MasterData;
|
|
using Centron.Data.WebServices.Administration.MandatoryArea;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.Entities.BranchArea;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.NumberGroupTests.Ticket125719
|
|
{
|
|
public class Ticket125719 : EndToEndTest
|
|
{
|
|
// the problem that we had was, when we create a new mandant and a new branch to it
|
|
// the number groups for that branch would be created, but never shown in the UI
|
|
// the reason for it was taht we were trying to get the branch number groups where
|
|
// current value was != null and != 0, which was of course not the case since
|
|
// the new number groups are created with value null for current and the list would be empty
|
|
|
|
// test workflow:
|
|
// 1. create new mandant
|
|
// 2. create new branch for mandant
|
|
// 3. create number groups for the new branch
|
|
// 4. get number groups for the new branch
|
|
|
|
public Ticket125719(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
var mandantI3D = this.CreateNewMandant();
|
|
var branchI3D = this.CreateNewBranchForNewMandant(mandantI3D);
|
|
this.GetNumberGroupsForNewBranch(mandantI3D, branchI3D);
|
|
}
|
|
|
|
private int CreateNewMandant()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var newMandant = new MandatoryExtendedDTO
|
|
{
|
|
Mandator = "Ticket 125719",
|
|
State = 1
|
|
};
|
|
|
|
var mandant = session.GetBL<MandatorWebServiceBL>().SaveMandatoryExtended(newMandant).ThrowIfError();
|
|
|
|
return mandant.I3D;
|
|
}
|
|
}
|
|
|
|
private int CreateNewBranchForNewMandant(int mandantI3D)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var country = session.GetBL<CountryWebServiceBL>().GetDefaultCountry();
|
|
var federalState = session.GetBL<FederalStateWebServiceBL>().GetFederalStates().FirstOrDefault();
|
|
|
|
var newBranch = new BranchDTO
|
|
{
|
|
Name = "Branch for Ticket 125719",
|
|
MandatorI3D = mandantI3D,
|
|
CountryI3D = country.I3D,
|
|
FederalState = federalState,
|
|
CreatedDate = DateTime.Now,
|
|
IsDefault = 0,
|
|
Status = 1,
|
|
};
|
|
|
|
var branch = session.GetBL<BranchWebServiceBL>().SaveBranchDetails(newBranch).ThrowIfError();
|
|
|
|
return branch.I3D;
|
|
}
|
|
}
|
|
|
|
private void GetNumberGroupsForNewBranch(int mandantI3D, int branchI3D)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
session.GetBL<MandatorWebServiceBL>().CreateNumberGroups(mandantI3D, branchI3D).ThrowIfError();
|
|
|
|
var numberGroups = session.GetBL<BranchWebServiceBL>().GetNumberGroupsForBranch(mandantI3D, branchI3D).ThrowIfError();
|
|
|
|
this.Verifier.Verify($"GetNumberGroupsForBranch", numberGroups);
|
|
}
|
|
}
|
|
}
|
|
}
|