What's a good way to debug unit tests written with multiple [Row] attributes?

When I run the next test in Gallio Icarus it passes, but when I enter it with TestDriven.NET (Test With-> Debugger) it fails because the parameters are not set according to the Row attributes.

I expected the method to be called once for each Row attribute.

What am I doing wrong? If nothing else, what do I need to do to debug these tests when they break? Should I avoid parameterized tests if they are not debuggable?

[TestFixture]
public class TestDrivenIgnoresMbUnitAttributesWhenDebugging
{
    [Test]
    [Row(1)]
    [Row(2)]
    public void SomeFunc(int x)
    {
        Assert.AreNotEqual(default(int), x);
    }
}

      

0


source to share


1 answer


Hmm ... did you install TestDriven.Net before installing Gallio?

If not, then the Gallio extensions for TestDriven.Net will not be installed. In this case TestDriven.Net can run the test in "ad-hoc" mode with default values ​​for its parameters.



It should be good to say if this is so. If the Gallio extensions for TestDriven.Net are installed, you will see the "Gallio" banner message in the output window while the test is running. If not, you might see something like "ad-hoc".

To fix the problem, reinstall Gallio. Alternatively, you can use the Add / Remove Features component of the Gallio installer, then make sure the TestDriven.Net components are selected for installation (under Test Runners).

+2


source







All Articles