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
103 lines
3.4 KiB
C#
103 lines
3.4 KiB
C#
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Sales.Support;
|
|
using Centron.BusinessLogic.WebServices.Sales.Support;
|
|
using Centron.Data.WebServices.Sales.Support;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.Helpdesk
|
|
{
|
|
public class HelpdeskSolutionTests : EndToEndTest
|
|
{
|
|
private readonly int _referenceHelpdeskI3D = 10491;
|
|
private readonly int _referenceSolutionI3D = 38;
|
|
|
|
public HelpdeskSolutionTests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
this.GetSolutions();
|
|
|
|
this.GetSolution();
|
|
this.SaveSolution();
|
|
|
|
this.AddSolutionToHelpdesk();
|
|
this.RemoveSolutionFromHelpdesk();
|
|
}
|
|
|
|
private void GetSolutions()
|
|
{
|
|
using var session = new BLSession();
|
|
|
|
var filter = new SearchHelpdeskSolution();
|
|
|
|
var solutions = session.GetBL<HelpdeskSolutionWebServiceBL>().GetHelpdeskSolutions(filter);
|
|
|
|
this.Verifier.Verify("Solutions", solutions);
|
|
}
|
|
|
|
private void GetSolution()
|
|
{
|
|
var solution = this.GetSolutionInternal();
|
|
this.Verifier.Verify("Solution", solution);
|
|
}
|
|
|
|
private void SaveSolution()
|
|
{
|
|
var solution = this.GetSolutionInternal();
|
|
|
|
solution.Caption = "Grafikkarte ist nicht defekt";
|
|
|
|
solution.MainCategoryI3D = 28;
|
|
solution.SubCategory1I3D = 29;
|
|
solution.SubCategory2I3D = 39;
|
|
|
|
using var session = new BLSession();
|
|
var updatedSolution = session.GetBL<HelpdeskSolutionWebServiceBL>().SaveHelpdeskSolution(this.GetLoggedInUser(), solution);
|
|
|
|
this.Verifier.Verify("UpdatedSolution", updatedSolution);
|
|
}
|
|
|
|
private HelpdeskSolutionDTO GetSolutionInternal()
|
|
{
|
|
using var session = new BLSession();
|
|
return session.GetBL<HelpdeskSolutionWebServiceBL>().GetHelpdeskSolutionByI3D(this._referenceSolutionI3D);
|
|
}
|
|
|
|
private void AddSolutionToHelpdesk()
|
|
{
|
|
// the helpdesk does not have a solution assigned in the beginning
|
|
|
|
using var session = new BLSession();
|
|
var result = session.GetBL<HelpdeskSolutionWebServiceBL>().AssignSolutionToHelpdesk(this.GetLoggedInUser(), this._referenceHelpdeskI3D, this._referenceSolutionI3D);
|
|
|
|
Assert.Equal(ResultStatus.Success, result.Status);
|
|
|
|
var solution = this.GetSolutionFromHelpdeskInternal();
|
|
this.Verifier.Verify("AddedSolution", solution);
|
|
}
|
|
|
|
private HelpdeskSolutionDTO GetSolutionFromHelpdeskInternal()
|
|
{
|
|
using var session = new BLSession();
|
|
return session.GetBL<HelpdeskSolutionWebServiceBL>().GetHelpdeskSolutionFromHelpdesk(this._referenceHelpdeskI3D);
|
|
}
|
|
|
|
private void RemoveSolutionFromHelpdesk()
|
|
{
|
|
using var session = new BLSession();
|
|
var result = session.GetBL<HelpdeskSolutionWebServiceBL>().RemoveSolutionFromHelpdesk(this.GetLoggedInUser(), this._referenceHelpdeskI3D);
|
|
|
|
Assert.Equal(result.Status.ToString(), ResultStatus.Success.ToString());
|
|
|
|
var solution = this.GetSolutionFromHelpdeskInternal();
|
|
Assert.Null(solution);
|
|
}
|
|
}
|
|
}
|