Background: I am trying to run a C# unit test (test is using Xunit Framework), and my requirement is to run a single unit test and not all the tests in the whole dll.
Things I tried: I have tried few commands, but with no luck till now.
I tried
dotnet test "complete_path/someTestDll.dll"
Result : This starts running all the test in the dll (expected but not desired)Tried
dotnet test "complete_path/someTestDll.dll" \Tests: "Namespace.ClassName.MethodToRun"
Result: Dll containing the test found but no test matches the filter.Tried
dotnet test "complete_path/someTestDll.dll" --filter "FullyQualifiedName=Namespace.ClassName.MethodToRun"
No test matching filter is found (again path to dll is alright)Tried
dotnet test "complete_path/someTestDll.dll" --filter "DisplayName=Namespace.ClassName.MethodToRun"
Not only these but various mix and match of these with complete path, relative path, etc. etc. and almost wasted whole day.
NOTE: I know there are few answers on this over SO, but I have tried them all, from last day, and nothing seems to be working for me till now, so I had to come here to get some help.
Looks like I am missing something serious, Hopefully, I can get some answers which solves my issue.
Thanks a lot!!
[Fact(Skip = "Your reason to not run the test")]
the skip parameter to your tests? I guess this wouldn't be ideal if you intend to run some of them later. – LallageFullyQualifiedName=Namespace.ClassName.MethodToRun
to work. The only reason it didn't work was if I didn't have the fully qualified name put in correctly or the method wasn't a test. I wonder if there's something wrong with the fully qualified name. – Lallage