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

95 lines
3.4 KiB
C#

using Centron.BusinessLogic;
using Centron.BusinessLogic.WebServices.Administration.FileManagement;
using Centron.Data.WebServices.Administration.FileManagement;
using Centron.Tests.EndToEnd.Infrastructure;
using System;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Directories
{
public class DirectoriesTests : EndToEndTest
{
private int _referenceDirectoryI3D => 65;
public DirectoriesTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
// need to be ignored so we don't get an actual version from the assembly which is always different
this.Verifier.Settings.IgnoreProperty<DirectoryDTO>(f => f.ChangedVersion);
this.Verifier.Settings.IgnoreProperty<DirectoryDTO>(f => f.CreatedVersion);
}
public override void Execute()
{
// since these are new values they would only ever be null
this.Sql("UPDATE Directorys SET ChangedBy = 22, ChangedDate = '2021-01-01', CreatedVersion = '2.3.4.5', CreatedBy = 22, CreatedDate = '2020-01-01', ChangedVersion = '2.3.4.5' ");
this.UserDirectoryRights();
this.LoadRootDirectory();
this.LoadDirectory();
this.RenameDirectory();
this.DeleteDirectory();
}
private void UserDirectoryRights()
{
using (var session = new BLSession())
{
var settings = session.GetBL<DirectoryWebServiceBL>().GetUserDirectorySettings(this.GetLoggedInUser());
this.Verifier.Verify("UserDirectorySettings", settings);
}
}
private void LoadRootDirectory()
{
using (var session = new BLSession())
{
var root = session.GetBL<DirectoryWebServiceBL>().GetRootDirectory(this.GetLoggedInUser());
this.Verifier.Verify("RootDirectory", root);
}
}
private void LoadDirectory()
{
var directory = this.LoadReferenceDirectory();
this.Verifier.Verify("ReferenceDirectory", directory);
using (var session = new BLSession())
{
var subDirectories = session.GetBL<DirectoryWebServiceBL>().GetSubDirectories(this.GetLoggedInUser(), this._referenceDirectoryI3D);
this.Verifier.Verify("ReferenceSubDirectories", subDirectories);
}
}
private void RenameDirectory()
{
using (var session = new BLSession())
{
session.GetBL<DirectoryWebServiceBL>().UpdateDirectoryName(this.GetLoggedInUser(), this._referenceDirectoryI3D, "newName");
}
var directory = this.LoadReferenceDirectory();
this.Verifier.Verify("RenamedReferenceDirectory", directory?.Name);
}
private void DeleteDirectory()
{
using (var session = new BLSession())
{
session.GetBL<DirectoryWebServiceBL>().DeleteDirectory(this.GetLoggedInUser(), this._referenceDirectoryI3D);
}
var directory = this.LoadReferenceDirectory();
Assert.Null(directory);
}
private DirectoryDTO LoadReferenceDirectory()
{
using var session = new BLSession();
return session.GetBL<DirectoryWebServiceBL>().GetDirectory(this.GetLoggedInUser(), this._referenceDirectoryI3D)?.Data;
}
}
}