using Centron.BusinessLogic; using Centron.BusinessLogic.Sales.Receipts.DataAndResults; using Centron.BusinessLogic.WebServices.Sales.Receipts; using Centron.Interfaces; using Centron.Interfaces.BL; using Centron.Tests.EndToEnd.Infrastructure; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.TicketTests.Ticket124592; public class Ticket124592Tests : EndToEndTest { public Ticket124592Tests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } // In Ticket 124592 the customer had a problem when creating a new receipt-version, from an older version // I couldn't really reproduce the issue, so I wrote some tests here to check if it works public override void Execute() { this.CreateNewVersion(CentronObjectKindNumeric.OfferClass, receiptI3D: 56, version: 2); //Current Version is 4 this.CreateNewVersion(CentronObjectKindNumeric.OrderClass, receiptI3D: 14, version: 1); //Current Version is 2 // Couldn't find a Delivery-List in the database that works, so be lazy for now this.CreateNewVersion(CentronObjectKindNumeric.InvoiceClass, receiptI3D: 171, version: 1); //Current Version is 2 } private void CreateNewVersion(CentronObjectKindNumeric receiptKind, int receiptI3D, int version) { using var session = new BLSession(); var newVersionResult = session.GetBL().CreateNewVersion( receiptKind, receiptI3D, version, newContactPersonI3D: null, this.GetLoggedInUser().User, new CreateNewVersionData { IgnoreCallbacks = true }).ThrowIfError(); this.Verifier.Verify($"NewVersionOfReceipt_{receiptKind.GetReceiptShortName()}_{receiptI3D}_Version_{version}", newVersionResult); } }