Example #1
0
        /// <summary>
        /// Applies the constraint to an actual value, returning a ConstraintResult.
        /// </summary>
        /// <param name="actual">The value to be tested</param>
        /// <returns>A ConstraintResult</returns>
        public override ConstraintResult ApplyTo <TActual>(TActual actual)
        {
            bool matched = _expected.Equals(actual);

            if (!matched)
            {
                _writer.GetFormattedResults();
                _exposed = _writer.Exposed;
            }
            return(new MatchingResult(_exposed, this, actual, matched));
        }
Example #2
0
 public MatchingResult(WritableEqualityResult exposed, IConstraint constraint, object actualValue, bool isSuccess) : base(constraint, actualValue, isSuccess)
 {
     _exposed = exposed;
 }