Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC) Posts: 7,340
Thanks: 991 times Was thanked: 1334 time(s) in 1237 post(s)
|
Hi Josh, Thanks for sharing this issue. After a quick test I've concluded that NCrunch's handling of the ExpectedException attribute within MSTest2012 doesn't work correctly with the new async behaviour. I've logged this down to be fixed in the next maintenance release. Meanwhile, I suggest working around the issue by implementing the assertion manually. For example: Code:
[TestMethod]
public async Task Integration_FailingTest_ThrowsException()
{
try
{
await someMethod;
}
catch (Exception ex)
{
if (ex is SomeCustomException == false)
Assert.Fail("Exception thrown was " + ex.InnerException + ", which is not the expected exception");
}
}
Cheers, Remco
|