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

67 lines
2.9 KiB
C#

using System.Collections.Generic;
using System.Linq;
using Centron.BusinessLogic.Mail.Factory;
using Centron.BusinessLogic.WebServices.Administration.MasterData;
using Centron.BusinessLogic.WebServices.Sales.Receipts;
using Centron.BusinessLogic.WebServices.Sales.Support;
using Centron.Data.WebServices.Administration.Employees;
using Centron.Data.WebServices.EmployeeArea;
using Centron.Interfaces;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.TicketTests.Ticket135987;
public class Ticket135987Tests : EndToEndTest
{
public Ticket135987Tests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public const int OrderI3D = 120;
public const int NewEditorI3D = 28;
public override void Execute()
{
// 1. Create a ticket from an order
// 2. Change the editor in that ticket
// 3. Make some changes in the order again, to see the "create ticket from order" dialog again
//
// The problem now is, that the dialog shows the wrong editor
// It shows the original one again (usually the one, who's service article was used to created the ticket)
// But it should show the current ticket editor
using (TestMails.Start(out var mails))
{
// 1. Create a ticket from the order
var createdTickets = this.WithSession(s => s.GetBL<ReceiptWebServiceBL>().CreateHelpdesksForReceipt(CentronObjectKindNumeric.OrderClass, OrderI3D, null, this.GetLoggedInUser().User)).ThrowIfError();
// 2. Change the editor in that ticket
var helpdeskI3D = createdTickets.First().HelpdeskI3D;
this.ChangeHelpdeskEditor(helpdeskI3D);
// 3. Call the "create ticket from order" method again
var ticketInfos = this.WithSession(s => s.GetBL<ReceiptWebServiceBL>().GetHelpdeskInfosForReceipt(CentronObjectKindNumeric.OrderClass, OrderI3D, this.GetLoggedInUser().User)).ThrowIfError();
// Should be the new editor I3D now
Assert.Equal(NewEditorI3D, ticketInfos.Single.First().EmployeeI3D);
// For good measure, also use the Verifier to check all properties
this.Verifier.Verify("TicketInfos", ticketInfos);
}
}
private void ChangeHelpdeskEditor(int helpdeskI3D)
{
var helpdesk = this.WithSession(s => s.GetBL<HelpdeskWebServiceBL>().GetHelpdeskByI3D(helpdeskI3D, this.GetLoggedInUser())).ThrowIfError();
var employees = this.WithSession(s => s.GetBL<EmployeeWebserviceBL>().GetEmployeePreviews(new List<int> { NewEditorI3D })).ThrowIfError();
helpdesk.Editors = employees.ToList();
this.WithSession(s => s.GetBL<HelpdeskWebServiceBL>().SaveHelpdesk(helpdesk, this.GetLoggedInUser())).ThrowIfError();
}
}