AreEqual() public méthode

Compares two objects for equality within a tolerance.
public AreEqual ( object x, object y, Tolerance &tolerance ) : bool
x object
y object
tolerance Tolerance
Résultat bool
        private bool ItemsEqual(object expected, object actual)
        {
            Tolerance tolerance = Tolerance.Zero;

            return(comparer.AreEqual(expected, actual, ref tolerance));
        }
Exemple #2
0
        /// <summary>
        /// Compares two collection members for equality
        /// </summary>
        protected bool ItemsEqual(object x, object y)
        {
            Tolerance tolerance = Tolerance.Zero;

            return(comparer.AreEqual(x, y, ref tolerance));
        }
        /// <summary>
        /// Test whether the constraint is satisfied by a given value
        /// </summary>
        /// <param name="actual">The value to be tested</param>
        /// <returns>True for success, false for failure</returns>
        public override bool Matches(object actual)
        {
            this.actual = actual;

            return(comparer.AreEqual(expected, actual, ref tolerance));
        }