Ejemplo n.º 1
0
        // <summary>
        // Compare two object trees. If all the descendant logical nodes
        // are equivalent, return true, otherwise, return false.
        // </summary>
        // <param name="firstTree">The root for the first tree.</param>
        // <param name="secondTree">The root for the second tree.</param>
        // <param name="fileName">Custom list of properties to ignore.</param>
        // <remarks>
        // Compares every event and property for each the node.
        // </remarks>
        // <returns>
        // A structure containing result. If the returned variable name is result.
        // result.Result is CompareResult.Equivalent in the case two nodes are equivalent,
        // and CompareResult.Different otherwise.
        // </returns>
        private static TreeComparerResult CompareLogical(
            Object firstTree,
            Object secondTree,
            string fileName)
        {
            Dictionary <string, PropertyToIgnore> props = TreeComparer.ReadSkipProperties(fileName);

            return(TreeComparer.CompareLogical(firstTree, secondTree, props));
        }
Ejemplo n.º 2
0
        // <summary>
        // Compare two object trees. If all the descendant logical nodes
        // are equivalent, return true, otherwise, return false.
        // </summary>
        // <param name="firstTree">The root for the first tree</param>
        // <param name="secondTree">The root for the second tree</param>
        // <remarks>
        // Compares every event and property for each the node.
        // </remarks>
        // <returns>
        // A structure containing result. If the returned variable name is result.
        // result.Result is CompareResult.Equivalent in the case two nodes are equivalent,
        // and CompareResult.Different otherwise.
        // </returns>
        public static TreeComparerResult CompareLogical(
            Object firstTree,
            Object secondTree)
        {
            TreeComparerResult result = TreeComparer.CompareLogical(firstTree, secondTree, TreeComparer._skipPropertiesDefault);

            ObjectGraphComparer.XamlCompareParity(firstTree, secondTree, result.Result);

            return(result);
        }