Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CodeLense visibility for xUnit theory tests. #62

Merged

Conversation

DTeuchert
Copy link
Contributor

Add CodeLense visibility for xUnit theory tests, which can be tested with XunitTests.TestCase3.cs.
Solves #61

grafik

@stefanforsberg
Copy link
Collaborator

Hey @DTeuchert and thanks for the PR! At the moment it's not possible to run a single test with theories. The command generated (for instance --filter FullyQualifiedName~XunitTests.TestClass3.Pass2(value: 2)) can not be executed. I'm not sure if xunit supports running a specific theory or not.

Would you mind looking into if you could make that work?

…or for a special test case.

For running a single test `runTestByName` needs to specify the filter param by "=".
@DTeuchert
Copy link
Contributor Author

To run theories your command must be modified to --filter FullyQualifiedName~XunitTests.TestClass3.Pass without specify the testdata in parameters. In the pull request I have made a replacement.

Another problem occured by running the filter parameter (FullyQualifiedName) by using "~" which behaves similar to a like (for instance runTestByName(XunitTests.TestClass3.Pass) also tests the testcase Pass2). Therefore I distinguish whether the test is executed on a folder (class or root) or for a special test case. For running a single test runTestByName needs to specify the filter parameter (FullyQualifiedName) by "=".

@stefanforsberg
Copy link
Collaborator

Currently only xunit supports FQN (until #51 is merged anyway) so by using = instead of ~ you can not run specific tests for nunit or mstest.

So that perhaps leads to unit test framework specific code which I'd rather avoid if possible. But the current model of running more tests than expected (Pass, Pass2... PassN) is not ideal either. Hmm.

@DTeuchert
Copy link
Contributor Author

I agree that framework specific code should be avoided. I suggest that I will revert the changes regarding FQN. The replacement in the testName is necessary to run single theory test cases.

@stefanforsberg stefanforsberg merged commit 3b292f8 into formulahendry:master Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants