Class ThrowsException
Exception thrown when Assert.Throws fails.
public class ThrowsException : XunitException, ISerializable, IAssertionException
- Inheritance
-
ThrowsException
- Implements
- Inherited Members
Methods
ForIncorrectExceptionType(Type, Exception)
Creates a new instance of the ThrowsException class to be thrown when an exception of the wrong type was thrown by Assert.Throws.
public static ThrowsException ForIncorrectExceptionType(Type expected, Exception actual)
Parameters
Returns
ForIncorrectParameterName(Type, string?, string?)
Creates a new instance of the ThrowsException class to be thrown when an ArgumentException is thrown with the wrong parameter name.
public static ThrowsException ForIncorrectParameterName(Type expected, string? expectedParamName, string? actualParamName)
Parameters
expectedTypeThe exception type
expectedParamNamestringThe expected parameter name
actualParamNamestringThe actual parameter name
Returns
ForNoException(Type)
Creates a new instance of the ThrowsException class to be thrown when an exception wasn't thrown by Assert.Throws.
public static ThrowsException ForNoException(Type expected)
Parameters
expectedTypeThe expected exception type