using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Centron.BusinessLogic; using Centron.BusinessLogic.Sales.Receipts; using Centron.Interfaces; using Centron.Interfaces.ExcelExport; using Centron.Tests.EndToEnd.Infrastructure; using Xunit.Abstractions; using DevExpress.Spreadsheet; using System.IO; using System.Diagnostics; namespace Centron.Tests.EndToEnd.TicketTests.Ticket117749 { public class Ticket117749Test : EndToEndTest { public Ticket117749Test(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { this.ReceiptExport(receiptKind: CentronObjectKindNumeric.OfferClass, receiptI3D: 1, showPositionOnly: false, showWithoutPurchasePrice: false); this.ReceiptExport(receiptKind: CentronObjectKindNumeric.OfferClass, receiptI3D: 1, showPositionOnly: false, showWithoutPurchasePrice: true); this.ReceiptExport(receiptKind: CentronObjectKindNumeric.OfferClass, receiptI3D: 1, showPositionOnly: true, showWithoutPurchasePrice: false); this.ReceiptExport(receiptKind: CentronObjectKindNumeric.OfferClass, receiptI3D: 1, showPositionOnly: true, showWithoutPurchasePrice: true); } public byte[] ReceiptExport(CentronObjectKindNumeric receiptKind, int receiptI3D, bool showPositionOnly, bool showWithoutPurchasePrice) { using (var session = new BLSession()) { var settings = new ReceiptExcelExportSettings() { ShowPositionOnly = showPositionOnly, ShowWithoutPurchasePrice = showWithoutPurchasePrice}; var excel = session.GetBL().ExportReceiptToExcel(receiptKind, receiptI3D, settings); var name = $"ReceiptExport_ShowPositionOnly_{settings.ShowPositionOnly}_ShowWithoutPurchasePrice_{settings.ShowWithoutPurchasePrice}"; this.Verifier.VerifyExcel(name, excel); return excel; } } } }