using Centron.BusinessLogic.Administration.Settings; using Centron.BusinessLogic.Mail.Factory; using Centron.BusinessLogic.WebServices.Sales.Receipts; using Centron.BusinessLogic.WebServices.Sales.Support; using Centron.Data.WebServices.Sales.Support; using Centron.Interfaces; using Centron.Interfaces.Administration.Settings; using Centron.Interfaces.BL; using Centron.Tests.EndToEnd.Infrastructure; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.Tests.ReceiptTicketPattern; public class ReceiptTicketPatternTests : EndToEndTest { public ReceiptTicketPatternTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public const int OrderI3D = 120; public override void Execute() { this.PrepareDatabase(); using (TestMails.Start(out var mails)) { var ticketInfos = this.WithSession(s => s.GetBL().GetHelpdeskInfosForReceipt(CentronObjectKindNumeric.OrderClass, OrderI3D, this.GetLoggedInUser().User)).ThrowIfError(); this.Verifier.Verify("TicketInfos", ticketInfos); } } private void PrepareDatabase() { // Set up AutomHelpdeskProcessorI3Ds to ensure correct employee assignment this.WithSession(s => { var settingsBL = s.GetBL(); var settings = settingsBL.GetSettingsForUpdate(ApplicationSettingID.AutomHelpdeskProcessorI3Ds); settings.UpdateString(ApplicationSettingID.AutomHelpdeskProcessorI3Ds, "44"); }); // Add Ticket-Pattern to article X var user = this.GetLoggedInUser(); this.WithSession(s => s.GetBL().SaveTicketPattern(new TicketPatternDTO { Caption = "Eine Ticketvorlage", InternalNote = "Interne-Notiz aus dem Pattern", Description = "Beschreibung aus dem Pattern", ArticleI3D = 84, IsActive = true, DurationInDays = 7, }, user)); } }