Questions tagged [runsettings]

Unit tests in Visual Studio can be configured by using a *.runsettings file. (The file name doesn’t matter, provided you use the extension ‘.runsettings.’) For example, you can change the .NET Framework on which the tests will be run, the directory where test results are delivered, and the data collected during a test run.

Unit tests in Visual Studio can be configured by using a *.runsettings file. (The file name doesn’t matter, provided you use the extension ‘.runsettings.’) For example, you can change the .NET Framework on which the tests will be run, the directory where test results are delivered, and the data collected during a test run.

Questions regarding syntax/utilization of the .RunSettings file should use this tag.

https://msdn.microsoft.com/en-us/library/jj635153.aspx

49 questions
47
votes
9 answers

How to access TestRunParameters within RunSettings file

Reading through https://msdn.microsoft.com/en-us/library/jj635153.aspx I have created a .RunSettings files with a few parameters similar to the example:
Kritner
  • 13,557
  • 10
  • 46
  • 72
11
votes
2 answers

How to read .runsettings test parameter in xUnit fixture

I'm writing xUnit unit test cases for a dotnet core application which uses DocumentDB (CosmosDB) as storage. The unit test are written to execute against the local cosmos db emulator. On the Azure DevOps build environment, I've setup the Azure…
user1672994
  • 10,509
  • 1
  • 19
  • 32
8
votes
0 answers

How can I force inclusion of untested assemblies to Code Coverage?

I'm trying to make Visual Studio's Code Coverage tool useful. I'm working on a legacy project and in order to refactor all this code I add unit tests. The problem is, when I measure code coverage I only see three dll assemblies that have tested…
8
votes
1 answer

How to execute tests in parallel using runsettings file on VS2013

we have moved from VS2010 to VS2013 environment. Our solution has over 5K unit tests and on VS2010 they took about 5 minutes while on VS2013 they are taking about 20 minutes. We saw that there is an issue using the testsettings file as it configures…
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
7
votes
1 answer

Using .runsettings to exclude namespaces from assemblies

I'm trying to exclude all namespaces but Acme.Foundations.Web.Ext.Controllers from assembly Acme.Foundations.web.ext.dll. Please help create a runsettings file.
billboard
  • 785
  • 4
  • 13
  • 25
7
votes
2 answers

How can I force exclusion of certain assemblies from Code Coverage?

I'm trying to restrict the assemblies that get analyzed in the Code Coverage procedure in TFS by using a runsettings file, but some assemblies insist in being analyzed even if I exclude them explicitly. This is my current runsettings file…
julealgon
  • 7,072
  • 3
  • 32
  • 77
6
votes
4 answers

How do I pass runtime parameters to dotnet test on the command line?

I have a set of unit tests in a .NET Core project and using a runsettings file. I am trying to setup Azure DevOps to do automated testing on my deployments. As part of this process, I need to override parameters from the run settings on the command…
David
  • 113
  • 1
  • 1
  • 7
6
votes
1 answer

vstest.console.exe generate cover for only Moq.dll

I am trying to generate code coverage report using vstest.console.exe. I am also using .runsettings file and passing it as a parameter. Whatever I am trying to do, it generates a coverage report for only moq.dll. I am sharing below the full text of…
Nazim
  • 639
  • 2
  • 10
  • 26
6
votes
1 answer

No code coverage in VSTS when .runsettings file supplied

We're having trouble with code coverage on our Visual Studio Online (VSTS) build definition, where no results are returned when we define a custom .runsettings file. Locally this is working fine, however, when we update our build definition on…
JadedEric
  • 1,943
  • 2
  • 26
  • 49
6
votes
2 answers

vstset.console.exe assembly resolution fails

I have a UnitTests.dll, to which Common.dll is referenced (both built with VS2015). I have following directory structure: C:\Test\ - UnitTests.dll - UnitTests.runsettings C:\Bin\ - Common.dll UnitTests.runsettings content is as…
jwaliszko
  • 16,942
  • 22
  • 92
  • 158
5
votes
0 answers

Specify Relative File Paths with RunSettings File

I am seeking a way to define assembly resolution values using relative file paths. I am approaching this by defining and referencing an environment variable as recommend by the Microsoft documentation. As you can see from the code snippet below, I…
5
votes
0 answers

C# unit testing - ordered test with runsettings file

I'm trying to develope an automated regression test framework as unit tests. So I use ordered test to combine the different test steps and combine them in an easy to use way. For configuration purposes i wanna use the runsettings file, especially…
4
votes
3 answers

Runsettings file in visual studio code

I have some unit tests in my project that needs runsettings file to run properly. When I launch those tests, I have issues with parameters that should be taken from the runsettings file My question is how can I pass the runsettings file to visual…
user3032668
  • 63
  • 1
  • 3
4
votes
2 answers

How to run unit tests with .NET version 4.6.2 in Visual Studio 2019?

I'm trying to resolve this warning from unit test runs in Visual Studio: [6/7/2019 7:16:21 PM Warning] Test run will use DLL(s) built for framework .NETFramework,Version=v4.5 and platform X64. Following DLL(s) do not match framework/platform…
4
votes
2 answers

Exclude test code from code metrics

Is it at all possible to exclude Class Libraries or code files from code metrics? I cannot find good resources on this as they all seem to focus on Code Coverage, which can be set in a .runsettings file. I would like to have a build without warnings…
Aage
  • 5,932
  • 2
  • 32
  • 57
1
2 3 4