using System; using System.Linq; using Centron.BusinessLogic; using Centron.BusinessLogic.Sales.Receipts; using Centron.BusinessLogic.Warehousing; using Centron.Data.Entities.Logistics.Warehousing; using Centron.Data.Entities.Sales.Receipts.SupplierDeliveryLists; using Centron.Tests.EndToEnd.Infrastructure; using Xunit; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.TicketTests.Ticket137215; public class Ticket137215Tests : EndToEndTest { public Ticket137215Tests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { var exception = Assert.Throws(() => { ReceiptSupplierDeliveryList receipt; using (var session = new BLSession()) { receipt = session.GetBL().GetReceiptByI3D(4141); } var item = receipt.Items.First(f => f.I3D == 4577); using (var session = new BLSession()) { session.GetBL().WriteAmountChangeLog(receipt, item, new Stock() { I3D = -1, Caption = "Hauptlager"}, 5, 10, base.GetLoggedInUser().User); } using (var session = new BLSession()) { session.GetBL().WriteAmountChangeLog(receipt, item, new Stock() { I3D = -1, Caption = "Hauptlager"}, 5, 10, base.GetLoggedInUser().User); } }); Assert.Equal("Mehrfachbuchung beim Artikel entdeckt, internes c-entron Ticket 137215!", exception.Message); } }