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

112 lines
5.1 KiB
C#

using System.Collections.Generic;
using Centron.BusinessLogic;
using Centron.BusinessLogic.WebServices.Accounts.AccountContracts;
using Centron.Interfaces.Accounts.AccountContracts;
using Centron.Tests.EndToEnd.Infrastructure;
using Centron.Tests.EndToEnd.Infrastructure.Verifier;
using CentronSoftware.Centron.WebServices.Entities.Accounts.AccountContracts;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Account.AccountContracts
{
public class AccountContractKindTests : EndToEndTest
{
public AccountContractKindTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
Verifier.Settings.IgnoreProperty<AccountContractKindDTO>(f => f.CreatedVersion);
Verifier.Settings.IgnoreProperty<AccountContractKindDTO>(f => f.ChangedVersion);
Verifier.Settings.IgnoreProperty<AccountContractKindDTO>(f => f.CreatedDate);
Verifier.Settings.IgnoreProperty<AccountContractKindDTO>(f => f.ChangedDate);
}
public override void Execute()
{
using (var session = new BLSession())
{
var testedBL = session.GetBL<AccountContractKindWebServiceBL>();
CreateAccountContractKind(testedBL);
CreateAccountContractKindFailing(testedBL);
GetAccountContractKindByI3D(testedBL);
// insert additional contracts
CreateAdditionalAccountContractKinds(testedBL);
GetAccountContractKinds(testedBL);
CreateAccountContractFromKind(session.GetBL<AccountContractWebServiceBL>());
}
}
private void CreateAccountContractKind(AccountContractKindWebServiceBL testedBL)
{
var newEntity = CreateTestAccountContractKind();
var saveResult = testedBL.SaveAccountContractKind(this.GetLoggedInUser(), newEntity);
this.Verifier.Verify("SaveNewAccountContractKind_Successful", saveResult);
}
private void CreateAccountContractKindFailing(AccountContractKindWebServiceBL testedBL)
{
var newEntity = new AccountContractKindDTO();
var saveResult = testedBL.SaveAccountContractKind(this.GetLoggedInUser(), newEntity);
this.Verifier.Verify("SaveNewAccountContractKind_Failing", saveResult);
}
private void GetAccountContractKindByI3D(AccountContractKindWebServiceBL testedBL)
{
var result = testedBL.GetAccountContractKindByI3D(this.GetLoggedInUser(), 1);
this.Verifier.Verify("GetAccountContractKindByI3D_Result", result);
}
private void GetAccountContractKinds(AccountContractKindWebServiceBL testedBL)
{
var filter = new GetAccountContractKindsFilter();
filter.IsActive = true;
filter.BranchI3Ds = new List<int> { 0 };
var result = testedBL.GetAccountContractKinds(this.GetLoggedInUser(), filter);
this.Verifier.Verify("GetAccountContractKinds", result);
}
private void CreateAdditionalAccountContractKinds(AccountContractKindWebServiceBL testedBL)
{
var newEntity = CreateTestAccountContractKind();
newEntity.Name = "Vorlage 1";
newEntity.BranchI3D = 1;
testedBL.SaveAccountContractKind(this.GetLoggedInUser(), newEntity);
newEntity = CreateTestAccountContractKind();
newEntity.Name = "Vorlage 2";
newEntity.BranchI3D = 0;
newEntity.IsDeleted = true;
testedBL.SaveAccountContractKind(this.GetLoggedInUser(), newEntity);
newEntity = CreateTestAccountContractKind();
newEntity.Name = "Vorlage 3";
newEntity.BranchI3D = 0;
testedBL.SaveAccountContractKind(this.GetLoggedInUser(), newEntity);
}
private void CreateAccountContractFromKind(AccountContractWebServiceBL testedBL)
{
var verifier = new CentronVerifierSettings();
verifier.IgnoreProperty<AccountContractDTO>(f => f.CreatedVersion);
verifier.IgnoreProperty<AccountContractDTO>(f => f.ChangedVersion);
verifier.IgnoreProperty<AccountContractDTO>(f => f.CreatedDate);
verifier.IgnoreProperty<AccountContractDTO>(f => f.ChangedDate);
var result = testedBL.CreateAccountContractFromKind(this.GetLoggedInUser(), 1, 1029);
Verifier.Verify("CreateAccountContractFromKind_WithAccountRef", result, verifier);
result = testedBL.CreateAccountContractFromKind(this.GetLoggedInUser(), 1, null);
Verifier.Verify("CreateAccountContractFromKind_WithoutAccountRef", result, verifier);
}
private AccountContractKindDTO CreateTestAccountContractKind()
{
var entity = new AccountContractKindDTO();
entity.Name = "Telekom Handy Vertrag";
entity.AutomatedProlongation = true;
entity.Prolongation = 12;
entity.BranchI3D = 0;
entity.CountryI3D = 1;
return entity;
}
}
}