using System.Linq; using Centron.BusinessLogic; using Centron.BusinessLogic.Sales.Receipts; 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.Tests.ReceiptProgression { public class ReceiptProgressionTests : EndToEndTest { public ReceiptProgressionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } private const int SupplierOrderI3D = 146; public override void Execute() { this.GetDirectoriesFromReceiptProgression(); this.GetReceiptProgression(); } private void GetDirectoriesFromReceiptProgression() { using (var session = new BLSession()) { var directoryI3Ds = session.GetBL().GetDirectoryI3DsFromReceiptProgression(SupplierOrderI3D, CentronObjectKindNumeric.SupplierOrder); this.Verifier.Verify($"DirectoryI3DsFromProgressionForSupplierOrder{SupplierOrderI3D}", directoryI3Ds); } } private void GetReceiptProgression() { using (var session = new BLSession()) { var progression = session.GetBL().GetReceiptProgression(null, SupplierOrderI3D, CentronObjectKindNumeric.SupplierOrder, limit: null).ThrowIfError() .OrderByDescending(f => f.IsCurrent) .ThenBy(f => f.ObjectKind) .ThenBy(f => f.I3D) .ToList(); this.Verifier.Verify($"ProgressionForSupplierOrder{SupplierOrderI3D}", progression); } } } }