Ejemplo n.º 1
0
        public bool AnalizeCruise()
        {
            var srcFile  = GetTempFilePath(".crz3", "HasDesignKeyChanges_srcFile");
            var destFile = GetTempFilePath(".crz3", "HasDesignKeyChanges_destFile");

            var cruiseID = CruiseID;

            using (var srcDb = CreateDatabaseFile(srcFile))
                using (var destDb = CreateDatabaseFile(destFile))
                {
                    var cruiseChecker = new CruiseChecker();

                    var cruiseConflicts    = cruiseChecker.GetCruiseConflicts(srcDb, destDb, cruiseID);
                    var isCruiseInConflict = cruiseConflicts.Any();

                    var saleConflicts    = cruiseChecker.GetSaleConflicts(srcDb, destDb, cruiseID);
                    var isSaleInConflict = saleConflicts.Any();


                    var plotConflicts       = cruiseChecker.GetPlotConflicts(srcDb, destDb, cruiseID);
                    var treeConflicts       = cruiseChecker.GetTreeConflicts(srcDb, destDb, cruiseID);
                    var logConflicts        = cruiseChecker.GetLogConflicts(srcDb, destDb, cruiseID);
                    var hasDesignKeyChanges = cruiseChecker.HasDesignKeyChanges(srcDb, destDb, cruiseID);

                    return(plotConflicts.Count() == 0 &&
                           treeConflicts.Count() == 0 &&
                           logConflicts.Count() == 0 &&
                           !hasDesignKeyChanges &&
                           !isCruiseInConflict &&
                           !isSaleInConflict);
                }
        }
Ejemplo n.º 2
0
        public void DiffSampleGroupKeys()
        {
            var srcFile  = GetTempFilePath(".crz3", "DiffSampleGroupKeys_srcFile");
            var destFile = GetTempFilePath(".crz3", "DiffSampleGroupKeys_destFile");

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

                    var result = cc.DiffSampleGroupKeys(srcDb, desDb, CruiseID);
                }
        }
Ejemplo n.º 3
0
        public void HasDesignKeyChanges()
        {
            var srcFile  = GetTempFilePath(".crz3", "HasDesignKeyChanges_srcFile");
            var destFile = GetTempFilePath(".crz3", "HasDesignKeyChanges_destFile");

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

                    var result = cc.HasDesignKeyChanges(srcDb, desDb, CruiseID);
                }
        }
Ejemplo n.º 4
0
        public void GetTreeConflicts()
        {
            var srcFile  = GetTempFilePath(".crz3", "GetTreeConflicts_srcFile");
            var destFile = GetTempFilePath(".crz3", "GetTreeConflicts_destFile");

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

                    var result = cc.GetTreeConflicts(srcDb, desDb, CruiseID);
                    result.Should().BeEmpty();
                }
        }
Ejemplo n.º 5
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();
                }
        }