using Centron.BusinessLogic; using Centron.BusinessLogic.WebServices.Administration.FileManagement; using Centron.Tests.EndToEnd.Infrastructure; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.Tests.DocSync { public class DocSyncTests : EndToEndTest { public DocSyncTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { this.PrepareDatabase(); this.GetDocSyncActiveDirectoriesAndOwners(); } private void PrepareDatabase() { // there are no directorys with active docsync so we have to set some // we just use Auftrag (since it's a customer subdir) and Bestellung (supplier subdir) this.Sql("UPDATE Directorys SET IsDocSyncActive = 1 WHERE Name LIKE 'Auftrag %'"); this.Sql("UPDATE Directorys SET IsDocSyncActive = 1 WHERE Name LIKE 'Bestellung %'"); using (var session = new BLSession()) { // there are also no documents so have to add some session .GetBL() .AddDocumentToSpecialDirectory(this.GetLoggedInUser(), "ibims1file", new byte[20], 1321, Interfaces.CentronObjectKindNumeric.OrderClass); session .GetBL() .AddDocumentToSpecialDirectory(this.GetLoggedInUser(), "ibims2file", new byte[20], 1322, Interfaces.CentronObjectKindNumeric.OrderClass); session .GetBL() .AddDocumentToSpecialDirectory(this.GetLoggedInUser(), "ibims3file", new byte[20], 1, Interfaces.CentronObjectKindNumeric.SupplierOrder); } } private void GetDocSyncActiveDirectoriesAndOwners() { using (var session = new BLSession()) { var directories = session.GetBL().GetDocSyncActiveDirectoriesAndOwners(); this.Verifier.Verify("DocSyncActiveDirectoresAndOwners", directories); } } } }