Affecto.Patterns.Domain.Tests.Infrastructure.ExpectedInnerExceptionAttribute.ExpectedInnerExceptionAttribute C# (CSharp) Method

ExpectedInnerExceptionAttribute() public method

public ExpectedInnerExceptionAttribute ( Type exceptionType, Type innerExceptionType ) : System
exceptionType System.Type An expected type of exception to be thrown by a method.
innerExceptionType System.Type An expected type of inner exception to be thrown by a method.
return System
        public ExpectedInnerExceptionAttribute(Type exceptionType, Type innerExceptionType)
        {
            if (exceptionType == null)
            {
                throw new ArgumentNullException("exceptionType");
            }
            if (innerExceptionType == null)
            {
                throw new ArgumentNullException("innerExceptionType");
            }
            if (!typeof(Exception).IsAssignableFrom(exceptionType))
            {
                throw new ArgumentException("Expected exception type must derive from exception.", "exceptionType");
            }
            if (!typeof(Exception).IsAssignableFrom(innerExceptionType))
            {
                throw new ArgumentException("Expected inner exception type must derive from exception.", "innerExceptionType");
            }

            ExceptionType = exceptionType;
            InnerExceptionType = innerExceptionType;
        }
ExpectedInnerExceptionAttribute