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.Ticket139328; public class Ticket139328Tests : EndToEndTest { public Ticket139328Tests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public const int OrderI3D = 4369; public const int CrmProjectI3D = 21; public const string CrmProjectNumber = "80018"; public override void Execute() { // In this ticket the problem was, that when you updated the ProjectNumber in a receipt without a new version // Then that receipt would not correctly be assigned to the CRM-Project this.VerifyCrmProjectObjects("Before"); this.WithSession(s => s.GetBL().UpdateReceiptProjectNumber( CentronObjectKindNumeric.OrderClass, OrderI3D, CrmProjectNumber, concurrencyControlGuid: null, this.GetLoggedInUser().User)).ThrowIfError(); this.VerifyCrmProjectObjects("After"); } private void VerifyCrmProjectObjects(string name) { this.Verifier.VerifySql(name, $"SELECT * FROM CRMProjektObjekt WHERE CRMProjektI3D = {CrmProjectI3D} AND ObjektI3D = {OrderI3D} AND ObjektArt = 2 ORDER BY I3D ASC"); } }