Skip to content

NUnit test cases view in the HTML report #236

@ghost

Description

Hi,

Using Nunit and BDDfy, when creating single test method with several test cases , each test case is shown in the report as a test with the name of the test method.
Even if you set a different name for each test case, you still get the same name for all test cases.

For instance:

Using this code:

[TestFixture]
public class SomeClass
{
    [Test , TestCaseSource(typeof(SomeClass),nameof(TestCases))]
    public void SomeTest(int num)
    {
        this.Given(_ => hi())
            .Then(_ => bye())
            .BDDfy();
    }
    public void hi() { }
    public void bye() { }
    public static IEnumerable TestCases
    {
        get
        {
            yield return new TestCaseData(1).SetName("Some Test #1");
            yield return new TestCaseData(2).SetName("Some Test #2");
        }
    }
}

On the left you see the name given for each test case on Reshaper test runner.
On the right you can see that each test case got the test method name.

test report

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions