Questions tagged [dotnet-test]
63 questions
1
vote
1 answer
Print all test cases along with passed/failed using dotnet test/nunit console runner
I'm looking to print all the test cases along with their status(pass/fail) like below:
TestCaseOne --> Passed
TestCaseTwo --> Failed
TestCaseThree --> Passed
I have tried this from this link console runner test , but it only prints the test names,…
user19540656
1
vote
1 answer
Run c# tests in multi-stage docker container
I have following dockerfile which runs my tests:
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
COPY ./ ./
RUN dotnet restore ./mysln.sln -r linux-x64
RUN dotnet build ./tests/mytests/mytests.csproj
ENTRYPOINT ["dotnet", "test",…

Shadow
- 2,089
- 2
- 23
- 45
1
vote
0 answers
Test dotnet specifically via the .NET framework
I have a dotnet project and some unit tests.
When I run: dotnet test it actually tests the unit tests using the .NET Core App, but I also do want to test against .NET framework as well.
Is there any way I can specifically target the dotnet test to…

StandardProc
- 85
- 1
- 8
1
vote
0 answers
Azure DevOps Test Case parameters as DataSource in .NET Core
Currently I am using Azure DevOps as my platform for maintaining tests and testdata (using the parameters feature). We also have Test Automation in place with the testcases written in Selenium for .NET5 (soon to be .NET6). To know which variables…

Jurn
- 796
- 1
- 8
- 19
1
vote
0 answers
How can I run 'dotnet test' on a solution file with both UWP and .NET Core / .NET 6 test projects?
I have a solution that contains several .NET Standard, .NET Core, .NET 6, and finally UWP projects in it.
Additionally, I have test projects for everything, including the UWP projects.
My problem is, is that I cannot run the dotnet test, or even the…

Aron
- 372
- 5
- 18
1
vote
0 answers
Disable hang dump generated by dotnet test
When I run dotnet test ... --blame-hang-timeout 2000 it generates a 'Hang Dump' which grows into gigabytes. This feature is available since .NET 5.0, and the Microsoft pages refer to a DUMP_TYPE. Because of this size, I want to disable the…

Timon Post
- 2,779
- 1
- 17
- 32
1
vote
1 answer
Object Reference not set to an instance with Coverlet dotnet core
I've recently installed coverlet 2.6.0 via the dotnet core CLI (command: dotnet add package coverlet.msbuild) by following this guide: https://dev.to/deinsoftware/net-core-unit-test-and-code-coverage-with-visual-studio-code-37bp however I've run…

Novastorm
- 1,439
- 3
- 26
- 40
0
votes
1 answer
How do I configure the concurrency level of XUnit through the the `dotnet test` CLI?
How do I configure the concurrency level of XUnit when run through the the dotnet test CLI ?
I've followed the advice from this thread: XUnit dotnet test parallel threads amount
and created a xunit.runner.json file that I believe ends up in the…

KeyboardDrummer
- 577
- 5
- 21
0
votes
0 answers
why dotnet test --collect requires obj folder
I have two projects in my solution, a class library and a test library (lets call them Library and Tests.Library).
My library project targets .NETStandard2.0 and my test project is based on the visual studio NUnit project template (using coverlet),…

fharreau
- 2,105
- 1
- 23
- 46
0
votes
0 answers
Coverlet doesn't appear to respect Function Exclusions in my .runsettings file
I have a .runsettings file which excludes autogenerated methods that are typically associated with async/await code, i.e. MoveNext() in my case. This is my .runsettings file:
…

ilitirit
- 16,016
- 18
- 72
- 111
0
votes
0 answers
How to get complete information about the test cases via dotnet test command
How can I get the complete test tree with dotnet test?
Tests write with nunit framework
I can use --list-tests, but I will only get a plane list of test cases. No class hierarchy, fixtures, test methods with multiple cases, etc.
Yes, I can do it…

Daniel
- 53
- 1
- 7
0
votes
0 answers
How to exclude a project from dotnet test run
I have two projects: UnitTests.csproj (xunit) and IntegrationTests.csproj (specflow)
I'm using
dotnet test MySolution.sln --filter FullyQualifiedName\!~IntegrationTests
to run unit tests.
However, my IntegrationTests.csproj project contains a method…

THX-1138
- 21,316
- 26
- 96
- 160
0
votes
0 answers
detect unit tests that took long time to respond
i'm new to unit testing , i have a lot of unit tests, how can i find tests that took long time to respond ?
i try this:
dotnet test -l "console;verbosity=detailed"
its good but i need to filter the tests than take more than 2 milisec!
1- how to…
0
votes
0 answers
Application works with docker command but not with docker compose
I created tests for my application using docker inside the dotnet tests. It pulls an image from rabbitmq and starts it before testing and it works fine.
Now I'm trying to add these tests to docker, but to run docker inside a container I'm using…

matmahnke
- 432
- 3
- 10
0
votes
0 answers
How can show all test that ran regardless if passed or failed using dotnet test?
I have a solution and in the solution is s directory where all tests reside.
I can run all tests using
dotnet test "c:\testing.dll"
It only shows in the console the name of the failed tests
and the end result shows how many passed.
Is there a…

Veronica
- 53
- 6