When a test fixture file has mutliple methods, and the method above a failing test are collapsed, when you click the link in the NCrunch Tests window to go to the line of code that is failing, the failing line is positions just off the top of the screen.
Specifically, using the test fixture code at the end of the post, the test "FailingTest" will fail and generate this message:
at NUnit.Framework.Assert.Fail(String message, Object[] args)
at NUnit.Framework.Assert.Fail()
at My.Test.Temp.FailingTest() in C:\Work\InRuleV4\v3.3_Main\InRuleForDynamicsCRM\InRule.Dynamics.Test\Temp.cs:line 55
If the file is completely expanded (no methods collapsed), and you click on the "line 55" link, it centers the failing test in the visible area of the visual studio window.
If the methods above FailingTest (named CollapseThisTest1 - 4) are collapsed, then when you click the link the first visible line in the visual studio window is line 56.
I have another fixture where there are hundreds of lines above and below the failing test, all of which are collapsed. In this case, clicking the link to the failing test takes me almost 100 lines further down the file than the actual line that's failing.
I would expect to have the line referenced in the link to be visible, and preferably centered in the window, even if the methods above it are collapsed.
System Info:
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.5.50131 SP1Rel
Installed Version: Premium
JetBrains ReSharper 7 EAP Full Edition build 7.0.51.137 on 2012-05-23T05:22:36
JetBrains ReSharper 7 EAP package for Microsoft Visual Studio. For more information about ReSharper, visit
http://www.jetbrains.com/resharper/. Copyright © 2003–2012 JetBrains, Inc.
NCrunch v1.39.0.15b
Continuous Testing Tool for .NET
Copyright © 2010-2012 Remco Software Ltd
Test Fixture to reproduce:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using NUnit.Framework;
namespace My.Test
{
[TestFixture]
public class Temp
{
[Test]
public void CollapseThisTest1()
{
//collapse this method
}
[Test]
public void CollapseThisTest2()
{
//collapse this method
}
[Test]
public void CollapseThisTest3()
{
//collapse this method
}
[Test]
public void CollapseThisTest4()
{
//collapse this method
}
[Test]
public void FailingTest()
{
Assert.Fail();
}
[Test]
public void FillerTest1()
{
//this is just to give some extra lines
//to the file
}
[Test]
public void FillerTest2()
{
//this is just to give some extra lines
//to the file
}
[Test]
public void FillerTest3()
{
//this is just to give some extra lines
//to the file
}
[Test]
public void FillerTest4()
{
//this is just to give some extra lines
//to the file
}
[Test]
public void FillerTest5()
{
//this is just to give some extra lines
//to the file
}
[Test]
public void FillerTest6()
{
//this is just to give some extra lines
//to the file
}
[Test]
public void FillerTest7()
{
//this is just to give some extra lines
//to the file
}
}
}