Consider the following test
Code:
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var items = new List<string> { "Dog", "Cat" };
var item = items.First();
Assert.AreEqual("Dog", item);
}
Now, if I debug the Test with Visual Studio I can use Enumerable.Extensions like
First() but with NCrunch I can not. This makes it sometimes very hard to debug ncrunch tests.
A great blog post why this is possible with Visual Studio can be found here.
http://blogs.msdn.com/b/...s-and-the-debugger.aspx
With MSTest
With NCrunch
If I understand the blog post right, it would be possible to achive this, If NCrunch would preload System.Core into it's debugger process. Is there a way to do this. I even tried the "Pre-load all assembly references into test environment" but it didn't help.
On a side note: Extension Methods within the same project seem to work. If I add
Code:
public static class ExtensionMethods
{
public static T First2<T>(this IEnumerable<T> source)
{
return source.First();
}
}
to the project I can use items.First2() in the debugger.
I use
- Visual Studio 2010 Profession
- Windows 8.1 x64
- NCrunch 2 (latest)