formulahendry / formulahendry/vscode-dotnet-test-explorer

Not possible to execute tests with parameterized TestFixtures

Open
#144 10 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
208
Forks
93
PR merge metrics
No merged PRs in 30d

Description

## Description

When trying to run a test case which has a [Parameterized TestFixture](https://github.com/nunit/docs/wiki/TestFixture-Attribute#parameterized-test-fixtures) the executions fails due to not finding the test case.
The reason is that the FQN used is missing the parameters.
This is the current output I get for the example below.
```
Executing dotnet test --logger "trx;LogFileName=/tmp/test-explorer/0.trx" --filter FullyQualifiedName~example.ExampleTests.Test_Example in ...
Build started, please wait...
Build completed.

Test run for .../example.dll(.NETCoreApp,Version=v2.0)
Microsoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170628-02
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
NUnit Adapter 3.10.0.21: Test execution started
Running all tests in .../example.dll
NUnit3TestExecutor converted 1 of 1 NUnit test cases
Skipping assembly - no matching test cases found
NUnit Adapter 3.10.0.21: Test execution complete
No test matches the given testcase filter `FullyQualifiedName~example.ExampleTests.Test_Example` in .../example.dll
```

## Solution

This is possible to execute on the command line using this filter:
```
dotnet test --logger "trx;LogFileName=/tmp/output.trx" --filter '"FullyQualifiedName~example.ExampleTests\(\"First\"\).Test_Example"'
```

## Example

```csharp
namepace example {
[TestFixture("First")]
[TestFixture("Second")]
public class ExampleTests
{
public ExampleTests(string arg)
{
// Do something with arg that affects the tests
}

[TestCase]
public void Test_Example()
{
// Test something
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.