Daily Usage Issues

TestContext.CurrentTestOutcome contains weird values

Started by jisotupa on 5,688 views

We have a custom base class, which we to use provide extendability to otherwise missing extendability of MSTest. In the [TestCleanup] method of the base class, the TestContext.CurrentTestOutcome is investigated to find out whether the test passed or failed.

Now, when running the test with NCrunch, the CurrentTestOutcome seems to contain a seemingly random integer instead one of the appropriate enum values. It even appears to change its value each call:

[img=(- BROKEN LINK -)]TestOutcome having a funny value[/img]

What's up?

Hi,

Thanks for sharing this issue.

NCrunch's support for MSTest is emulated (rather than integrated), which means that it is a complete re-implementation of the MSTest engine from the ground up.

The drawback of such an approach has the potential for compatibility holes. You've managed to find one of them.

I'll need to look into why this is happening, but it will likely require a code-fix to NCrunch's MSTest support. For the time being I recommend adjusting your implementation to work around this limitation.

Post a reply

Log in to reply.