Difference test case result between dotnet test and coverlet with dotnet test #1463
Unanswered
TerryChan2
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have a test dll and I can use dotnet test to execute the test cases without any problem
Command => dotnet test C:/projects/projectA/test/unit.tests.csproj --no-build -c Release
Result is shown as below:
Test run for C:\projects\projectA\test\bin\release\unit.tests.dll (.NETFramework,Version=v4.8)
Microsoft (R) Test Execution Command Line Tool Version 17.4.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Passed! - Failed: 0, Passed: 11, Skipped: 0, Total: 11, Duration: 63 ms - unit.tests.dll (net48)
However, if I run coverlet with the dotnet test, some test cases were failed
Command => coverlet C:\projects\projectA\test\bin\release\unit.tests.dll --target "dotnet" --targetargs "test C:/projects/projectA/test/unit.tests.csproj --no-build -c Release" --format cobertura --output "report"
Result is shown as below:
Test run for C:\projects\projectA\test\bin\release\unit.tests.dll (.NETFramework,Version=v4.8)
Microsoft (R) Test Execution Command Line Tool Version 17.4.0 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.94] unit.tests.TestNamespacesAreConsistent.Test_xxxxxx_NameSpace [FAIL]
[xUnit.net 00:00:00.94] unit.tests.TestNamespacesAreConsistent.Test_aaaaaa_NameSpace [FAIL]
[xUnit.net 00:00:00.94] unit.tests.TestNamespacesAreConsistent.Test_bbbbbb_NameSpace [FAIL]
[xUnit.net 00:00:00.95] unit.tests.TestNamespacesAreConsistent.Test_cccccc_NameSpace [FAIL]
[xUnit.net 00:00:00.97] unit.tests.TestNamespacesAreConsistent.Test_dddddd_NameSpace [FAIL]
[xUnit.net 00:00:00.97] unit.tests.TestNamespacesAreConsistent.Test_eeeeee_NameSpace [FAIL]
Failed unit.tests.TestNamespacesAreConsistent.Test_xxxxxx_NameSpace [445 ms]
Error Message:
Expected boolean to be true, but found False.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in //Src/FluentAssertions/Execution/XUnit2TestFramework.cs:line 35
at FluentAssertions.Execution.AssertionScope.FailWith(Func
1 failReasonFunc) in /_/Src/FluentAssertions/Execution/AssertionScope.cs:line 276 at FluentAssertions.Primitives.BooleanAssertions
1.BeTrue(String because, Object[] becauseArgs) in //Src/FluentAssertions/Primitives/BooleanAssertions.cs:line 76(All six cases were failed with the same error)
Failed! - Failed: 6, Passed: 5, Skipped: 0, Total: 11, Duration: 278 ms - unit.tests.dll (net48)
Any hint on the above difference between dotnet test and coverlet execution with dotnet test?
Beta Was this translation helpful? Give feedback.
All reactions