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
140 lines
7.1 KiB
C#
140 lines
7.1 KiB
C#
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Administration.Settings;
|
|
using Centron.BusinessLogic.WebServices.Administration.Settings.SettingGroups;
|
|
using Centron.BusinessLogic.WebServices.Sales.Support;
|
|
using Centron.Data.Entities.Administration.Settings.SettingGroups;
|
|
using Centron.Data.WebServices.Mail;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using System.Collections.Generic;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.Helpdesk
|
|
{
|
|
public class HelpdeskSettingsTests : EndToEndTest
|
|
{
|
|
private readonly int _referenceHelpdeskI3D = 10491;
|
|
|
|
public HelpdeskSettingsTests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
this.Verifier.Settings.CleanupProperty<MailBodyDTO>(f => f.Text, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskClosingExternalEmailBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskClosingInternalEmailBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskEMailForCustomerBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskEMailForEditorBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskEMailForOthersBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskForwardingExternalEmailBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.HelpdeskForwardingInternalEmailBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.NewTicketMailBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
this.Verifier.Settings.CleanupProperty<HelpdeskSettings>(f => f.OperationReportBodyRTF, RegexHelper.RtfInfo, "{\\info{\\author John Doe}");
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
this.GetUnchangedSettings();
|
|
|
|
this.GetSettingsWithEmailContent("MailSettings", "ForwardSettings", "CloseSettings");
|
|
|
|
this.ResetFormattingSettings();
|
|
this.GetSettingsWithEmailContent("UnformattedMailSettings", "UnformattedForwardSettings", "UnformattedCloseSettings");
|
|
|
|
this.UpdatePrefixSettings("", "");
|
|
this.GetSettingsWithEmailContent("NoPrefixUnformattedMailSettings", "NoPrefixUnformattedForwardSettings", "NoPrefixUnformattedCloseSettings");
|
|
|
|
this.UpdatePrefixSettings("emailPrefix", "globalPrefix");
|
|
this.GetSettingsWithEmailContent("BothPrefixesUnformattedMailSettings", "BothPrefixesUnformattedForwardSettings", "BothPrefixesUnformattedCloseSettings");
|
|
|
|
this.UpdatePrefixSettings("", "globalPrefix");
|
|
this.GetSettingsWithEmailContent("GlobalPrefixOnlyUnformattedMailSettings", "GlobalPrefixOnlyUnformattedForwardSettings", "GlobalPrefixOnlyUnformattedCloseSettings");
|
|
|
|
this.UpdatePrefixSettings("emailPrefix", "");
|
|
this.GetSettingsWithEmailContent("EmailPrefixOnlyUnformattedMailSettings", "EmailPrefixOnlyUnformattedForwardSettings", "EmailPrefixOnlyUnformattedCloseSettings");
|
|
|
|
}
|
|
|
|
private void GetUnchangedSettings()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var states = session.GetBL<HelpdeskWebServiceBL>().GetHelpdesksStates();
|
|
this.Verifier.Verify("HelpdeskStates", states);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var priorities = session.GetBL<HelpdeskWebServiceBL>().GetActiveHelpdeskPriorities();
|
|
this.Verifier.Verify("HelpdeskPriorities", priorities);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var types = session.GetBL<HelpdeskTypeWebServiceBL>().GetHelpdeskTypes(null);
|
|
this.Verifier.Verify("HelpdeskTypes", types);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var categories = session.GetBL<HelpdeskWebServiceBL>().GetActiveHelpdeskCategories();
|
|
this.Verifier.Verify("HelpdeskCategories", categories);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var timerTypes = session.GetBL<HelpdeskTimerTypeWebServiceBL>().GetHelpdeskTimerTypes();
|
|
this.Verifier.Verify("HelpdeskTimerTypes", timerTypes);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var helpdeskSettings = session.GetBL<AppSettingsGroupWebServiceBL>().GetHelpdeskSettings();
|
|
this.Verifier.Verify("HelpdeskSettings", helpdeskSettings);
|
|
}
|
|
}
|
|
|
|
private void GetSettingsWithEmailContent(string mailSettingsName, string forwardSettingsName, string closeSettingsName)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var mailSettings = session.GetBL<HelpdeskSettingsWebServiceBL>().GetHelpdeskMailSettings(this._referenceHelpdeskI3D, this.GetLoggedInUser());
|
|
this.Verifier.Verify(mailSettingsName, mailSettings);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var forwardSettings = session.GetBL<HelpdeskSettingsWebServiceBL>().GetForwardTicketEmailSettings(this._referenceHelpdeskI3D, this.GetLoggedInUser());
|
|
this.Verifier.Verify(forwardSettingsName, forwardSettings);
|
|
}
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
var closeSettings = session.GetBL<HelpdeskSettingsWebServiceBL>().GetCloseHelpdeskEmailSettings(this._referenceHelpdeskI3D, this.GetLoggedInUser());
|
|
this.Verifier.Verify(closeSettingsName, closeSettings);
|
|
}
|
|
}
|
|
|
|
private void ResetFormattingSettings()
|
|
{
|
|
// there are mailtemplates that got converted from the old settings
|
|
// we simply delete them so we get the default texts for everything again
|
|
this.Sql("DELETE FROM MailVorlagen WHERE ObjectKind = 10");
|
|
}
|
|
|
|
private void UpdatePrefixSettings(string emailSubjectPrefix, string globalPrefx)
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var updateSettings = session.GetBL<AppSettingsBL>().GetSettingsForUpdate
|
|
(
|
|
AppSettingsConst.HelpdeskEmailSubjectPrefix,
|
|
AppSettingsConst.GlobalEmailPrefix
|
|
);
|
|
|
|
updateSettings.UpdateString(AppSettingsConst.HelpdeskEmailSubjectPrefix, valueText: emailSubjectPrefix);
|
|
updateSettings.UpdateString(AppSettingsConst.GlobalEmailPrefix, valueText: globalPrefx);
|
|
|
|
updateSettings.SaveSettings();
|
|
}
|
|
}
|
|
}
|
|
}
|