Beispiel #1
0
        public void SyncTreeDefaultValues_Add()
        {
            var fromPath = base.GetTempFilePath(".crz3", "SyncTreeDefaultValues_Add_fromFile");
            var toPath   = base.GetTempFilePath(".crz3", "SyncTreeDefaultValues_Add_toFile");

            var syncOptions = new CruiseSyncOptions()
            {
                Processing = SyncFlags.Insert,
            };

            var init = new DatabaseInitializer()
            {
                TreeDefaults = null,
            };
            var cruiseID = init.CruiseID;
            var saleID   = init.SaleID;

            using var fromDb = init.CreateDatabaseFile(fromPath);

            fromDb.CopyTo(toPath, true);
            using var toDb = new CruiseDatastore_V3(toPath);

            var tdv = new TreeDefaultValue
            {
                CruiseID       = cruiseID,
                SpeciesCode    = "sp1",
                PrimaryProduct = "01",
            };

            fromDb.Insert(tdv);

            var syncer = new CruiseSyncer();

            syncer.Sync(cruiseID, fromDb, toDb, syncOptions);

            toDb.From <TreeDefaultValue>().Count().Should().Be(1);
        }
Beispiel #2
0
        public void GetSaleConflicts_dupSale()
        {
            var srcFile  = GetTempFilePath(".crz3", "GetSaleConflicts_srcFile");
            var destFile = GetTempFilePath(".crz3", "GetSaleConflicts_destFile");

            var saleNumber      = "12345";
            var srcInitialaizer = new DatabaseInitializer()
            {
                SaleNumber = saleNumber
            };
            var destInitializer = new DatabaseInitializer()
            {
                SaleNumber = saleNumber
            };

            using (var srcDb = srcInitialaizer.CreateDatabaseFile(srcFile))
                using (var desDb = destInitializer.CreateDatabaseFile(destFile))
                {
                    var cc = new CruiseChecker();

                    var result = cc.GetSaleConflicts(srcDb, desDb, srcInitialaizer.CruiseID);
                    result.Should().NotBeEmpty();
                }
        }
 public Datastore_TestBase(ITestOutputHelper output) : base(output)
 {
     DbInitializer = new DatabaseInitializer();
 }