Ask Your Question
4

What is the method to rerun the failed tests in my Dotnet Test?

asked 2021-06-04 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-11-19 23:00:00 +0000

scrum gravatar image

To rerun failed tests in Dotnet Test, you can use the "--filter" option with the "FullyQualifiedName" attribute of the failed test. This will isolate the failed test and run it again.

Here's an example:

  1. Run the Dotnet Test command to run all the tests:

    dotnet test

  2. The test results will show which tests failed. Take note of the FullyQualifiedName of the test that failed.

  3. Use the "--filter" option to run only the test that failed:

    dotnet test --filter "FullyQualifiedName=Namespace.ClassName.TestName"

    Replace "Namespace.ClassName.TestName" with the FullyQualifiedName of the failed test.

  4. The failed test will run again and the results will be displayed.

Note: You can also use the " --last-failed" option to run only the tests that failed in the last run.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-06-04 11:00:00 +0000

Seen: 1 times

Last updated: Nov 19 '22