Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

ExpectedException inheritance ingored
wilhelmmedetz
#1 Posted : Monday, July 27, 2015 9:06:29 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/4/2012(UTC)
Posts: 35

Was thanked: 2 time(s) in 2 post(s)
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();
}
}
Remco
#2 Posted : Monday, July 27, 2015 11:30:00 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.022 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download