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
198 lines
8.6 KiB
C#
198 lines
8.6 KiB
C#
using Centron.Interfaces.BL;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Finances.OnlineBanking;
|
|
using Centron.Data.Entities.Finances.OnlineBanking;
|
|
using Centron.Interfaces.Finances.OnlineBanking;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Centron.BusinessLogic.WebServices.Administration.CentronConfigDb;
|
|
using Xunit.Abstractions;
|
|
using CentronSoftware.Centron.WebServices.Entities.Finances.OnlineBanking;
|
|
using Xunit;
|
|
using Centron.BusinessLogic.WebServices.Finances.OnlineBanking;
|
|
using Centron.BusinessLogic.WebServices.PasswordManager;
|
|
using CentronSoftware.Centron.WebServices.Entities.PasswordManager;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.OnlineBanking
|
|
{
|
|
public class OnlineBankingConfigurationTest : EndToEndTest
|
|
{
|
|
private List<OnlineBankingConfigurationDTO> _finTSConfigurations;
|
|
private List<OnlineBankingConfigurationDTO> _spreadsheetConfigurations;
|
|
|
|
|
|
public OnlineBankingConfigurationTest(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
//this.Verifier.Settings.IgnoreProperty<DunningSettingsDTO>(f => f.AdvisorEmailTextVariables);
|
|
this._finTSConfigurations = new List<OnlineBankingConfigurationDTO>();
|
|
this._spreadsheetConfigurations = new List<OnlineBankingConfigurationDTO>();
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
this.PrepareDatabase();
|
|
|
|
// Create
|
|
this.CreateFinTSOnlineBankingConfigurations();
|
|
this.CreateSpreadsheetOnlineBankingConfigurations();
|
|
|
|
// Load
|
|
this.LoadFinTSOnlineBankingConfigurations();
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
var user = this.GetLoggedInUser();
|
|
// Use file instead of config DB
|
|
this.WithSession(f => f.GetBL<PasswordManagerWebServiceBL>().UpdatePasswordManagerSettings(user, new PasswordManagerSettingsDTO
|
|
{
|
|
IsPasswordManagerGuidelineManagementActive = false,
|
|
SecondsUntilNewAuthentificationPasswordManagerAccess = 0,
|
|
MasterPasswordSaveLocation = MasterPasswordSaveLocation.SecureFile,
|
|
MasterPasswordSecureFileName = "TestMasterKey.txt"
|
|
}));
|
|
var masterkeySaveresult = this.WithSession(f => f.GetBL<CentronConfigurationDbWebServiceBL>().SetHotlineMasterKey(user, "1234ABC567")).ThrowIfError();
|
|
Assert.True(masterkeySaveresult);
|
|
|
|
/* reset all invoices dunning stuff and close all
|
|
this.Sql(@"UPDATE RechKopf
|
|
SET Mahnung1Datum = NULL,
|
|
Mahnung1BearbeiterI3D = NULL,
|
|
Mahnung2Datum = NULL,
|
|
Mahnung2BearbeiterI3D = NULL,
|
|
Mahnung3Datum = NULL,
|
|
Mahnung3BearbeiterI3D = NULL,
|
|
MahnInfo = NULL,
|
|
MahnStop = NULL,
|
|
Mahnstufe = 0,
|
|
Datum = '2020-01-01 00:00:00.000',
|
|
FaelligAm = '2020-01-20 00:00:00.000',
|
|
Status = 2");
|
|
*/
|
|
}
|
|
|
|
private void CreateFinTSOnlineBankingConfigurations()
|
|
{
|
|
using var session = new BLSession();
|
|
var onlineBankingConfigurationBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
|
|
var user = this.GetLoggedInUser();
|
|
|
|
var fintsConfig1 = new OnlineBankingConfigurationFinTSDTO()
|
|
{
|
|
Name = "FINTS Testkonfiguration 1",
|
|
Description = "Das ist eine erste Testkonfiguration für HBCI",
|
|
BranchI3D = null,
|
|
CreatedByEmployeeI3D = user.UserI3D ?? 0,
|
|
CreatedDate = DateTime.Now,
|
|
CreatedVersion = "2310",
|
|
ChangedByEmployeeI3D = user.UserI3D ?? 0,
|
|
ChangedDate = DateTime.Now,
|
|
ChangedVersion = "2309",
|
|
IsFavorite = true,
|
|
AccountHolder = "Axel Schweiß",
|
|
AccountNumber = "0123456789",
|
|
AccountIBAN = "DE57630901000123456789",
|
|
AccountUserId = "Axel",
|
|
AccountUserPassword = "Schweiß",
|
|
BankCode = "63090100",
|
|
BankBIC = "ULMVDE66XXX",
|
|
ServiceURL = "https://www.volksbank.de/hbci",
|
|
ServiceVersion = "4.1",
|
|
};
|
|
|
|
var fintsConfig2 = new OnlineBankingConfigurationFinTSDTO()
|
|
{
|
|
Name = "FINTS Testkonfiguration 2",
|
|
Description = "Das ist eine zweite Testkonfiguration für HBCI",
|
|
BranchI3D = null,
|
|
CreatedByEmployeeI3D = user.UserI3D ?? 0,
|
|
CreatedDate = DateTime.Now,
|
|
CreatedVersion = "2310",
|
|
ChangedByEmployeeI3D = user.UserI3D ?? 0,
|
|
ChangedDate = DateTime.Now,
|
|
ChangedVersion = "2309",
|
|
IsFavorite = false,
|
|
AccountHolder = "Dieter Dünnbiss",
|
|
AccountNumber = "402048",
|
|
AccountIBAN = "DE72654500700000402048",
|
|
AccountUserId = "Ellen",
|
|
AccountUserPassword = "Bogen",
|
|
BankCode = "65450070",
|
|
BankBIC = "SBCRDE66XXX",
|
|
ServiceURL = "https://www.ksk-biberach.de/hbci",
|
|
ServiceVersion = "4.0",
|
|
};
|
|
|
|
|
|
var savedHbciConfig1 = onlineBankingConfigurationBL.SaveOnlineBankingConfiguration(fintsConfig1, user).ThrowIfError();
|
|
var savedHbciConfig2 = onlineBankingConfigurationBL.SaveOnlineBankingConfiguration(fintsConfig2, user).ThrowIfError();
|
|
|
|
this._finTSConfigurations.Add(savedHbciConfig1);
|
|
this._finTSConfigurations.Add(savedHbciConfig2);
|
|
}
|
|
|
|
private void CreateSpreadsheetOnlineBankingConfigurations()
|
|
{
|
|
using var session = new BLSession();
|
|
var onlineBankingBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
|
|
var user = this.GetLoggedInUser();
|
|
|
|
var spreadsheetConfig1 = new OnlineBankingConfigurationSpreadsheetDTO()
|
|
{
|
|
Name = "Spreadsheet (EXCEL) Testkonfiguration 1",
|
|
Description = "Das ist eine erste Testkonfiguration für EXCEL",
|
|
BranchI3D = null,
|
|
CreatedByEmployeeI3D = user.UserI3D ?? 0,
|
|
CreatedDate = DateTime.Now,
|
|
CreatedVersion = "2310",
|
|
ChangedByEmployeeI3D = user.UserI3D ?? 0,
|
|
ChangedDate = DateTime.Now,
|
|
ChangedVersion = "2309",
|
|
IsFavorite = true,
|
|
FileType = SpreadsheetFileType.EXCEL
|
|
};
|
|
|
|
var spreadsheetConfig2 = new OnlineBankingConfigurationSpreadsheetDTO()
|
|
{
|
|
Name = "Spreadsheet (CSV) Testkonfiguration 1",
|
|
Description = "Das ist eine erste Testkonfiguration für CSV",
|
|
BranchI3D = null,
|
|
CreatedByEmployeeI3D = user.UserI3D ?? 0,
|
|
CreatedDate = DateTime.Now,
|
|
CreatedVersion = "2310",
|
|
ChangedByEmployeeI3D = user.UserI3D ?? 0,
|
|
ChangedDate = DateTime.Now,
|
|
ChangedVersion = "2309",
|
|
IsFavorite = false,
|
|
FileType = SpreadsheetFileType.CSV
|
|
};
|
|
|
|
var savedSpreadsheetConfig1 = onlineBankingBL.SaveOnlineBankingConfiguration(spreadsheetConfig1, user).ThrowIfError();
|
|
var savedSpreadsheetConfig2 = onlineBankingBL.SaveOnlineBankingConfiguration(spreadsheetConfig2, user).ThrowIfError();
|
|
|
|
this._spreadsheetConfigurations.Add(savedSpreadsheetConfig1);
|
|
this._spreadsheetConfigurations.Add(savedSpreadsheetConfig2);
|
|
}
|
|
|
|
private void LoadFinTSOnlineBankingConfigurations()
|
|
{
|
|
using var session = new BLSession();
|
|
var onlineBankingConfigurationBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
|
|
var user = this.GetLoggedInUser();
|
|
|
|
var filter1 = new OnlineBankingConfigurationsFilter() { ConfigurationType = OnlineBankingConfigurationType.SERVICE_FINTS };
|
|
|
|
var result1 = onlineBankingConfigurationBL.GetOnlineBankingConfigurationsByFilter(filter1, isUnitTest: true).ThrowIfError();
|
|
|
|
var filter2 = new OnlineBankingConfigurationsFilter() { I3Ds = this._spreadsheetConfigurations.Select(f => f.I3D).ToList() };
|
|
|
|
var result2 = onlineBankingConfigurationBL.GetOnlineBankingConfigurationsByFilter(filter2, isUnitTest: true).ThrowIfError();
|
|
}
|
|
}
|
|
}
|