Files
Masterarbeit/QuellCode/CentronERP/tests/Centron.Tests.EndToEnd/Tests/Administration/Employees/EmployeeArticleParentTests.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

50 lines
2.3 KiB
C#

using System.Linq;
using Centron.BusinessLogic;
using Centron.BusinessLogic.EmployeeArea;
using Centron.BusinessLogic.Warehousing;
using Centron.BusinessLogic.WebServices.Employee;
using Centron.BusinessLogic.WebServices.Warehousing;
using Centron.Data.Entities.Merchandise.Articles;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Employees;
public class EmployeeArticleParentTests : EndToEndTest
{
public EmployeeArticleParentTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
public override void Execute()
{
using (var session = new BLSession())
{
// Test case 1: Set article with the I3D 11 to have a parent article with I3D 14
var article = session.GetBL<ArticleWebServiceBL>().GetArticleByArticleI3D(11);
article.ParentArticleI3D = 14;
var saveResult = session.GetBL<ArticleWebServiceBL>().SaveArticle(article, base.GetLoggedInUser());
Assert.True(saveResult.Status == ResultStatus.Success, saveResult.Message);
// Test case 2: Check if we get the article with I3D 11 when searching for articles with parent article I3D 14 from Employee with I3D 14
var bl = session.GetBL<EmployeeArticleWebServiceBL>();
var searchResult = bl.GetEmployeeArticlesAsArticle(new EmployeeArticleFilter()
{
EmployeeI3D = 25,
ParentArticleI3D = 14
}, base.GetLoggedInUser().User);
Assert.True(searchResult.FirstOrDefault()?.I3D == 11, $"Expected article with I3D 11, but found: {searchResult.FirstOrDefault()?.I3D}");
// Test case 3 : Check if we can retrieve the parent article of article with I3D 11
var articleBL = session.GetBL<ArticleWebServiceBL>();
var articleSearchResult = articleBL.GetArticlesThroughPaging(ArticlePreviewSort.ArticleCode, false,
new ArticleCompactFilter()
{
IsParentArticle = true
}, 1, 100);
Assert.True(articleSearchResult.Result.First().I3D == 14, $"Expected parent article with I3D 14, but found: {articleSearchResult.Result.First().I3D}");
}
}
}