Build/Test Issues

ExpectedException inheritance ingored

Started by wilhelmmedetz on 5,145 views

When using the MSTest ExpectedException NCrunch seems to ignore the attribute in derived methods.

See the following example.
The tests run with MSTest, but fail with NCrunch.

regards

Wilhelm


public abstract class ExpectedExceptionTestsBase40: TestFrame
{
[ExpectedException(typeof(InvalidOperationException))]
public virtual void TestMethod_Expexts_InvalidOperationException()
{
throw new InvalidOperationException();
}
}

[Log]
[TestClass]
public class ExpectedExceptionTests40: ExpectedExceptionTestsBase40
{
[TestMethod]
public override void TestMethod_Expexts_InvalidOperationException()
{
base.TestMethod_Expexts_InvalidOperationException();
}
}
Hi,

Thanks for sharing this issue.

This looks like a simple misalignment in NCrunch's MSTest emulation. I'll see that it gets fixed in the next version of NCrunch.

Post a reply

Log in to reply.