Example #1
0
 /// <summary>
 /// Verifies if there was an expected <see cref="Exception"/> that it has been handled.
 /// </summary>
 private void CheckForException()
 {
     if (_exceptionType != null && !_caughtException)
     {
         _assertionLog.Add(Assertion.AreEqual(_exceptionType, null, null));
     }
 }
Example #2
0
        /// <summary>
        /// Handles a <see cref="Exception"/> thrown by a test.
        /// </summary>
        /// <param name="exception">Exception.</param>
        private void HandleException(Exception exception)
        {
            if (_exceptionType == null || !_assertionLog.Add(Assertion.AreEqual(_exceptionType, exception.GetType(), null)))
            {
                _assertionLog.Add(exception);
            }

            _caughtException = true;
        }
Example #3
0
 /// <summary>
 /// Does the specified expected value equal the specified actual value?
 /// </summary>
 /// <param name="expected">Expected value.</param>
 /// <param name="actual">Actual value.</param>
 /// <typeparam name="T">Type.</typeparam>
 /// <returns>True if the specified expected value equals the specified actual value; otherwise, false.</returns>
 protected bool AreEqual <T>(T expected, T actual)
 {
     return(_assertionLog.Add(Assertion.AreEqual(expected, actual, _stackTraceTracker)));
 }