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

113 lines
5.2 KiB
C#

using System;
using System.Collections.Generic;
using Centron.BusinessLogic;
using Centron.BusinessLogic.WebServices.Accounts.AccountContracts;
using Centron.Interfaces.Accounts.AccountContracts;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.Entities.Accounts.AccountContracts;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Account.AccountContracts
{
public class AccountContractTests : EndToEndTest
{
public AccountContractTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
Verifier.Settings.IgnoreProperty<AccountContractDTO>(f => f.CreatedVersion);
Verifier.Settings.IgnoreProperty<AccountContractDTO>(f => f.ChangedVersion);
Verifier.Settings.IgnoreProperty<AccountContractDTO>(f => f.CreatedDate);
Verifier.Settings.IgnoreProperty<AccountContractDTO>(f => f.ChangedDate);
}
public override void Execute()
{
using (var session = new BLSession())
{
var accountContractBL = session.GetBL<AccountContractWebServiceBL>();
CreateAccountContract(accountContractBL);
CreateAccountContractFailing(accountContractBL);
GetAccountContractByI3D(accountContractBL);
// insert additional contracts
CreateAdditionalAccountContracts(accountContractBL);
GetAccountContracts(accountContractBL);
}
}
private void CreateAccountContract(AccountContractWebServiceBL accountContractBL)
{
var newAccountContract = CreateTestAccountContract();
var saveResult = accountContractBL.SaveAccountContract(this.GetLoggedInUser(), newAccountContract);
this.Verifier.Verify("SaveNewAccountContract_Successful", saveResult);
}
private void CreateAccountContractFailing(AccountContractWebServiceBL accountContractBL)
{
var newAccountContract = new AccountContractDTO();
var saveResult = accountContractBL.SaveAccountContract(this.GetLoggedInUser(), newAccountContract);
this.Verifier.Verify("SaveNewAccountContract_Failing", saveResult);
}
private void GetAccountContractByI3D(AccountContractWebServiceBL accountContractBL)
{
var result = accountContractBL.GetAccountContractByI3D(this.GetLoggedInUser(), 1);
this.Verifier.Verify("GetAccountContractByI3D_Result", result);
}
private void GetAccountContracts(AccountContractWebServiceBL accountContractBL)
{
var filter = new GetAccountContractsFilter();
filter.IsActive = true;
filter.AccountI3Ds = new List<int> { 1029 };
filter.BranchI3Ds = new List<int> { 0 };
filter.AccountContractKindI3Ds = new List<int> { 1 };
var result = accountContractBL.GetAccountContracts(this.GetLoggedInUser(), filter);
this.Verifier.Verify("GetAccountContracts", result);
}
private void CreateAdditionalAccountContracts(AccountContractWebServiceBL accountContractBL)
{
var newAccountContract = CreateTestAccountContract();
newAccountContract.Name = "Handy Vertrag Thomas Bauer";
newAccountContract.BranchI3D = 1;
accountContractBL.SaveAccountContract(this.GetLoggedInUser(), newAccountContract);
newAccountContract = CreateTestAccountContract();
newAccountContract.Name = "Handy Vertrag Sandra Hallow";
newAccountContract.BranchI3D = 0;
newAccountContract.IsClosed = true;
accountContractBL.SaveAccountContract(this.GetLoggedInUser(), newAccountContract);
newAccountContract = CreateTestAccountContract();
newAccountContract.Name = "Handy Vertrag Klara Walz";
newAccountContract.BranchI3D = 0;
newAccountContract.IsClosed = false;
accountContractBL.SaveAccountContract(this.GetLoggedInUser(), newAccountContract);
}
private AccountContractDTO CreateTestAccountContract()
{
var accountContract = new AccountContractDTO();
accountContract.ReferenceNumber = "Ref123";
accountContract.Date = new DateTime(2021, 2, 5);
accountContract.AccountI3D = 1029;
accountContract.Name = "Handy Vertrag James Müller";
accountContract.ContractBegin = new DateTime(2021,1,1);
accountContract.AutomatedProlongation = true;
accountContract.Prolongation = 12;
accountContract.BranchI3D = 0;
accountContract.NetTotalPrice = 40;
accountContract.GrossTotalPrice = 47.6m;
accountContract.CurrencyI3D = 1;
accountContract.CurrencyFactor = 1;
accountContract.CurrencyString = "€";
accountContract.AdditionalText = "Telekom MagentaMobil M";
accountContract.Email = "miller@telekom.de";
accountContract.CountryI3D = 1;
accountContract.AccountContractKindI3D = 1;
return accountContract;
}
}
}