Questions tagged [dotnet-test]

63 questions
21
votes
3 answers

How to debug dotnet test in VS Code?

This article describes setting the VS Code settings to point the debugging target at the build output of the unit test project. I have therefore set mine like this: { "explorer.confirmDragAndDrop": false, "git.allowForcePush": true, …
Matt W
  • 11,753
  • 25
  • 118
  • 215
15
votes
3 answers

Test multiple projects with dotnet test using pattern

I am writing a script to build and test projects in a repository. For now I'm using the PowerShell command Get-ChildItem -Path test -Filter *.csproj -Recurse | ForEach-Object { dotnet test $_.FullName -c $Configuration } to get all .csproj files in…
Valuator
  • 3,262
  • 2
  • 29
  • 53
15
votes
2 answers

dotnet test not creating test results folder

As part of our ASP.NET Core 2.0 build process I have added a dotnet test command which I have added as a Windows batch file. Here is my command. dotnet test "MyProject.csproj" --no-restore --results-directory "MyProject\TestResults" --verbosity…
DomBurf
  • 2,452
  • 5
  • 36
  • 71
11
votes
1 answer

Why dotnet test tool is not creating code coverage report?

My project structure is the following: . ├── Application ├── Application.Core ├── Application.Domain ├── Application.Tests ├── Application.IntegrationTests └── README.md And the command to run my test I use the following input: dotnet test…
ajr
  • 874
  • 2
  • 13
  • 29
10
votes
2 answers

How to merge two or more dotnet test code coverage files

I have a .Net solution with two dotnet core class libraries and its associated unit test projects in it. When I run dotnet test **\*.Tests.csproj --collect "Code Coverage" command then it generates separate .coveragexml files for each unit test…
Pradeep
  • 1,108
  • 1
  • 15
  • 31
6
votes
2 answers

xUnit - How to select a single Theory when executing from dotnet test CLI

Say I have a test: [Theory] [InlineData("one")] [InlineData("two")] public void ShouldSelectSingleTheoryFromDotnetTest(string s) { Assert.True(true); } I want to execute just the test with Theory data = "one" from the command line…
K S
  • 141
  • 3
6
votes
2 answers

Github Actions: Report dotnet test result as annotations

If you run tests using Azure Pipelines you would get some cool results on the checks tabs. Is there any way to do the same from Github Actions so we don't have to go through the console output?
hardkoded
  • 18,915
  • 3
  • 52
  • 64
6
votes
4 answers

How to run dotnet test on VSTS with custom NuGet feed?

We have a project with a dependency on a custom NuGet feed (also hosted in VSTS). I'm trying to put together a new phase to generate code coverage reports, as in this blog post. My new phase looks like this: And is made up of the following…
6
votes
3 answers

How can I debug my tests .Net Core 2.0 in VSCode

I'm searching a way to debug my tests (mstest) .Net Core 2.0 in VSCode? I didn't find nothing. Thanks!
5
votes
1 answer

How to add [ExcludeFromCodeCoverage] attribute at an assembly-level in a .Net Standard 2.1 project

I have a .Net Core application which has got one .Net Standard 2.1 project in it. I am using Coverlet to get the code coverage in Cobertura format. I am using "coverlet.msbuild" nuget package in all my Test projects. I want to add…
Pradeep
  • 1,108
  • 1
  • 15
  • 31
5
votes
2 answers

Azure Devops - How to pass environment variables into dotnet test?

I have a standard .NET Core (Ubuntu) pipeline on Azure Devops and within my Test project, I use environment variables. Within my pipeline, I have defined my group variables like so variables: - group: MyApiVariables Whenever I run the tests for my…
Mike
  • 2,561
  • 7
  • 34
  • 56
5
votes
0 answers

Run dotnet test without full SDK installed

I would like to run some nUnit tests on a build server, without having to install the .NET Core SDK there. The tests target netcoreapp3.1. For .NET Framework it was possible to run them using the nunit-console-runner, but it doesn't seem to be…
Grzegorz Smulko
  • 2,525
  • 1
  • 29
  • 42
5
votes
1 answer

'dotnet test' is not finding nunit tests in gitlab-runner pipeline

I have a solution with a NUnit testproject (Foo.Test). +-- src | +-- Foo.Gui | +-- Foo.Test netcoreapp3.0 false
Dominic Jonas
  • 4,717
  • 1
  • 34
  • 77
4
votes
0 answers

NUnit3 test adapter warnings on azure pipeline

recently without any direct changes to tests solution this error started occurring during execution of VSTEST@2 task on my azure pipeline. ##[warning]DiscoveryMessage : Failed to load extensions from file 'D:\a\1\s\src\...\NUnit3.TestAdapter.dll'.…
cyman1998
  • 73
  • 1
  • 7
4
votes
2 answers

Fixate version of Test Execution Command Line Tool

There is a bug in the Microsoft (R) Test Execution Command Line Tool Version 17.4.0 and we like to use 17.3.1. We are doing dotnet test in our Azure Pipeline: - task: UseDotNet@2 displayName: 'Use .NET 6' inputs: packageType: 'sdk' …
Julian
  • 33,915
  • 22
  • 119
  • 174
1
2 3 4 5