示例#1
0
        /// <summary>
        /// Checks whether the object under test is equivalent to another object.
        /// </summary>
        /// <param name="other">The other object to compare with.</param>
        /// <param name="message">Custom message for the assertion failure.</param>
        /// <returns>The current assertion.</returns>
        public TAssert IsEquivalentTo(object other, string message = null)
        {
            if (!EquivalencyHelper.AreEquivalent(Target, other))
            {
                Fail(new FailureBuilder("IsEquivalentTo()")
                     .Append(message)
                     .Append("Expecting", Target)
                     .Append("To be equivalent to", other)
                     .Finish());
            }

            return((TAssert)this);
        }
示例#2
0
 /// <summary>
 /// Determines whether the specified <see cref="object" />, is equal to this instance.
 /// </summary>
 /// <param name="obj">The <see cref="object" /> to compare with this instance.</param>
 /// <returns>
 ///   <c>true</c> if the specified <see cref="object" /> is equal to this instance; otherwise, <c>false</c>.
 /// </returns>
 public override bool Equals(object obj)
 => EquivalencyHelper.AreEquivalent(this, obj);