using Centron.BusinessLogic; using Centron.BusinessLogic.Warehousing; using Centron.BusinessLogic.Warehousing.ArticleManagement; using Centron.BusinessLogic.Warehousing.StockManagement; using Centron.Interfaces.Warehousing.StockManagement; using Centron.Tests.EndToEnd.Infrastructure; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.Tests { public class PriceUpdateTest : EndToEndTest { public PriceUpdateTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { DbPrepare(); ExecutePriceUpdate(); } private void DbPrepare() { Sql("update stammdat set Wert = 1 where i3d = 147"); Sql("update stammdat set wert = 1, WertNum = 1, WertText = 90 where i3d = 1182"); Sql("update HerstellerArtik set HEK = 192.6 where i3d0 = 4771531"); Sql("update HerstellerArtik set HEK = 2781 where i3d0 = 4771576"); Sql("update HerstellerArtik set HEK = 1872 where i3d0 = 4771579"); Sql("update HerstellerArtik set HEK = 72 where i3d0 = 4772202"); Sql("update HerstellerArtik set HEK = 89.1 where i3d0 = 4772311"); Sql("update Artik set Menge = 0 where i3d = 112"); Sql("update barcode set status = 4 where ArtikelI3D = 114 and status <3"); Sql("update barcode set status = 4 where ArtikelI3D = 69 and status <3"); Sql("update barcode set status = 4 where ArtikelI3D = 92 and status <3"); Sql("update barcode set status = 4 where ArtikelI3D = 29 and status <3"); Sql("update Nebenlager set EigenerEK = 1 where I3D in (1,3,7)"); } private void ExecutePriceUpdate() { using (var session = new BLSession()) { session.GetBL().AutomaticPriceUpdate(); List atricleI3Ds = new List() { 29, 69, 92, 112, 114, 128, 1222, 1232, 1305 }; var articles = session.GetBL().GetArticleCompactList(f => atricleI3Ds.Contains(f.I3D)); this.Verifier.Verify("ArticleMainStock", articles); ArticleStockPreviewFilter filter = new ArticleStockPreviewFilter() { I3Ds = new List { 46 } }; var stockarticles = session.GetBL().GetArticleStockCompacts(filter); this.Verifier.Verify("ArticleSecondaryStock", stockarticles); } } } }