Exemplo n.º 1
0
 public static void AreNotEqual(this Assert _, string notExpected, string actual, bool ignoreCase, CultureInfo culture, string message, params object[] parameters)
 {
     try
     {
         Assert.AreNotEqual(notExpected, actual, ignoreCase, culture, message, parameters);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 2
0
 public static void AreNotEqual(this Assert _, float notExpected, float actual, float delta, string message)
 {
     try
     {
         Assert.AreNotEqual(notExpected, actual, delta, message);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 3
0
 public static void AreNotEqual <T>(this Assert _, T notExpected, T actual, string message, params object[] parameters)
 {
     try
     {
         Assert.AreNotEqual(notExpected, actual, message, parameters);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 4
0
 public static void AreNotEqual(this Assert _, string notExpected, string actual, bool ignoreCase)
 {
     try
     {
         Assert.AreNotEqual(notExpected, actual, ignoreCase);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 5
0
 public static void AreEqual(this Assert _, double expected, double actual, double delta, string message, params object[] parameters)
 {
     try
     {
         Assert.AreEqual(expected, actual, delta, message, parameters);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 6
0
 public static void AreEqual <T>(this Assert _, T expected, T actual)
 {
     try
     {
         Assert.AreEqual <T>(expected, actual);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 7
0
 public static void AreNotEqual(this Assert _, double notExpected, double actual, double delta)
 {
     try
     {
         Assert.AreNotEqual(notExpected, actual, delta);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 8
0
 public static void AreSame(this Assert _, object expected, object actual, string message)
 {
     try
     {
         Assert.AreSame(expected, actual, message);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 9
0
 public static void IsNull(this Assert _, object value)
 {
     try
     {
         Assert.IsNull(value);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 10
0
 public static void IsNotNull(this Assert _, object value, string message, params object[] parameters)
 {
     try
     {
         Assert.IsNotNull(value, message, parameters);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 11
0
 public static void IsInstanceOfType(this Assert _, object value, Type expectedType)
 {
     try
     {
         Assert.IsInstanceOfType(value, expectedType);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 12
0
 public static void IsNotInstanceOfType(this Assert _, object value, Type wrongType, string message)
 {
     try
     {
         Assert.IsNotInstanceOfType(value, wrongType, message);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 13
0
 public static void IsFalse(this Assert _, bool condition, string message, params object[] parameters)
 {
     try
     {
         Assert.IsFalse(condition, message, parameters);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 14
0
 public static void IsFalse(this Assert _, bool condition)
 {
     try
     {
         Assert.IsFalse(condition);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 15
0
 public static void Inconclusive(this Assert _, string message)
 {
     try
     {
         Assert.Inconclusive(message);
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 16
0
 public static void Fail(this Assert _)
 {
     try
     {
         Assert.Fail();
     }
     catch (Exception ex)
     {
         DebuggerUtil.Attach();
         // throw and preserve stack trace
         ExceptionDispatchInfo.Capture(ex).Throw();
     }
 }
Exemplo n.º 17
0
        public static T ThrowsException <T>(this Assert _, Func <object> action) where T : Exception
        {
            try
            {
                return(Assert.ThrowsException <T>(action));
            }
            catch (Exception ex)
            {
                DebuggerUtil.Attach();
                // throw and preserve stack trace
                ExceptionDispatchInfo.Capture(ex).Throw();
            }

            throw new Exception("This should be never reached");
        }
Exemplo n.º 18
0
        public static Task <T> ThrowsExceptionAsync <T>(this Assert _, Func <Task> action, string message, params object[] parameters) where T : Exception
        {
            try
            {
                return(Assert.ThrowsExceptionAsync <T>(action, message, parameters));
            }
            catch (Exception ex)
            {
                DebuggerUtil.Attach();
                // throw and preserve stack trace
                ExceptionDispatchInfo.Capture(ex).Throw();
            }

            throw new Exception("This should be never reached");
        }