I am getting expectedExceptionType is a 'field' but used like a 'type' error from the if (exception is expectedExceptionType) line. However as you can see it is a Type. What is the problem here?
I am using Visual Studio 2013 with .NET 4.5
public sealed class ExpectedInnerException : ExpectedExceptionBaseAttribute
{
private Type expectedExceptionType;
private string expectedExceptionMessage;
public ExpectedInnerException(Type expectedExceptionType, string expectedExceptionMessage)
{
this.expectedExceptionType = expectedExceptionType;
this.expectedExceptionMessage = expectedExceptionMessage;
}
protected override void Verify(Exception exception)
{
if (exception is expectedExceptionType)
{
}
//Some other code
}
}