views:

113

answers:

1

When I run the following test in Gallio's Icarus it passes, but when I step into it using TestDriven.NET (Test With->Debugger), it fails because the parameters are not set according to the Row attributes.

I was expecting that the method would be called once for each Row attribute applied.

What am I doing wrong? If nothing, then what do I need to do to debug these tests when they break? Should I avoid parametrized 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);
    }
}
+2  A: 

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

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

It should be pretty to tell whether this is the case. If the Gallio extensions for TestDriven.Net are installed then you'll see a "Gallio" banner message in the Output Window during test execution. If not you may see something else like "ad-hoc".

To fix the problem, reinstall Gallio. Alternately you can use the add/remove features part of the Gallio installer then ensure that the TestDriven.Net components are selected for installation (under "Test Runners").

Jeff Brown
Thank you, that was it!
Dave