Exemplo n.º 1
0
        /// <summary>
        /// Compare two objects of the same type to each other.
        /// </summary>
        /// <remarks>
        /// Check the Differences or DifferencesString Properties for the differences.
        /// Default MaxDifferences is 1 for performance
        /// </remarks>
        /// <param name="expected"></param>
        /// <param name="actual"></param>
        /// <returns>True if they are equal</returns>
        public bool Compare(object expected, object actual)
        {
            string defaultBreadCrumb = string.Empty;

            Differences.Clear();
            Compare(expected, actual, defaultBreadCrumb);

            return(Differences.Count == 0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Compare two objects of the same type to each other.
        /// </summary>
        /// <remarks>
        /// Check the Differences or DifferencesString Properties for the differences.
        /// Default MaxDifferences is 1 for performance
        /// </remarks>
        /// <param name="object1"></param>
        /// <param name="object2"></param>
        /// <returns>True if they are equal</returns>
        public bool Compare(object object1, object object2)
        {
            string defaultBreadCrumb = string.Empty;

            Differences.Clear();
            Compare(object1, object2, defaultBreadCrumb);

            return(Differences.Count == 0);
        }
Exemplo n.º 3
0
        /// --------------------------------------------------------------------------------
        /// <summary>
        /// Recheck for differences. Useful in ReplaceCurWithRev tests.
        /// You could call DetectDifferences() directly to do the recheck, but his method
        /// provides cleaner error reporting in case the test didn't revert all
        /// original diffs first.
        /// </summary>
        /// --------------------------------------------------------------------------------
        public void DetectDifferences_ReCheck()
        {
            // the caller should have already reviewed all diffs
            Assert.AreEqual(0, Differences.Count);

            // re-init our output list, for a fresh start
            Differences.Clear();

            base.DetectDifferences(new DummyProgressDlg());
        }
        private void GetDifferencesCommandExecuted(object obj)
        {
            Differences.Clear();
            var differences = FileDifferenceChecker.GetFileVersionDifferences(FilePath1, FilePath2);

            foreach (var difference in differences)
            {
                Differences.Add(difference);
            }
        }
Exemplo n.º 5
0
        /// --------------------------------------------------------------------------------
        /// <summary>
        /// Expose the DetectDifferencesInListOfStTexts for testing.
        /// </summary>
        /// <param name="stTextsCurr"></param>
        /// <param name="stTextsRev"></param>
        /// --------------------------------------------------------------------------------
        new public void DetectDifferencesInListOfStTexts(List <IStText> stTextsCurr, List <IStText> stTextsRev)
        {
            // init our cluster differences list
            ClusterDiffs = new List <Difference>();

            base.DetectDifferencesInListOfStTexts(stTextsCurr, stTextsRev);

            // copy differences to the master list, where it's easy to verify them
            Differences.Clear();
            Differences.AddRange(ClusterDiffs);
        }
Exemplo n.º 6
0
        public void GetGetDifferenceInventoryLines(object parameter)
        {
            var selectedinventory = (InventoryModel)parameter;

            if (selectedinventory == null)
            {
                return;
            }

            using (var db = new PetaPoco.Database("db"))
            {
                try
                {
                    Differences.Clear();

                    Differences.AddRange(db.Fetch <DifferenceModel>("SELECT a.GTIN AS GTIN, a.ADesc AS ArtDesc, s.StorageName AS StorageName, a.ArticleId AS ArtId, il.Amt AS Amt, il.InventoryId AS InventoryId, il.InventoryLineId AS InventoryLineId FROM Articles a LEFT JOIN Storages s ON a.StorageId = s.StorageId LEFT JOIN InventoryLines il ON a.ArticleId = il.ArtId LEFT JOIN Inventories i ON i.InventoryId = il.InventoryId  WHERE (il.inventoryId = @0 OR il.inventoryId IS NULL) AND il.Amt <> 0 ORDER BY i.Dt "));
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Daten konnten nicht abgerufen werden:\n\n" + ex.Message), "Fehler");
                }
            }
        }