mstest

Is it possible to get Code Coverage of .NET Framework Project using coverlet in Azure DevOps?

不问归期 提交于 2021-02-11 17:19:25
问题 I easily configured to get the coverage result for .NET Core Projects in Azure DevOps, but no luck with .NET Framework Projects. So, I would be so grateful to get suggestion on this because coverlet documentation is clearly saying that we can also use it for .NET Framework Projects. This question is kinda similar to mine but I didn't see any answer there, Can you use Coverlet to get code coverage data in a .NET Framework project? 回答1: Yes, you can can code coverage data from a ASP.NET project

Where do I find TestContext.AddResultFile()?

自闭症网瘾萝莉.ら 提交于 2021-02-11 08:19:31
问题 I am having trouble referencing the documented method AddResultFile() on the TestContext class, allegedly found in the Microsoft.VisualStudio.TestTools.UnitTesting package/namespace. This is my package list: <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" /> <PackageReference Include="Selenium.Support" Version="3.141.0" /> <PackageReference Include="Selenium.WebDriver" Version="3.141.0" /> <PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="2.46.0" />

Where do I find TestContext.AddResultFile()?

别说谁变了你拦得住时间么 提交于 2021-02-11 08:19:21
问题 I am having trouble referencing the documented method AddResultFile() on the TestContext class, allegedly found in the Microsoft.VisualStudio.TestTools.UnitTesting package/namespace. This is my package list: <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" /> <PackageReference Include="Selenium.Support" Version="3.141.0" /> <PackageReference Include="Selenium.WebDriver" Version="3.141.0" /> <PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="2.46.0" />

Where do I find TestContext.AddResultFile()?

夙愿已清 提交于 2021-02-11 08:18:05
问题 I am having trouble referencing the documented method AddResultFile() on the TestContext class, allegedly found in the Microsoft.VisualStudio.TestTools.UnitTesting package/namespace. This is my package list: <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" /> <PackageReference Include="Selenium.Support" Version="3.141.0" /> <PackageReference Include="Selenium.WebDriver" Version="3.141.0" /> <PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="2.46.0" />

Unit-testing of a constructor

让人想犯罪 __ 提交于 2021-02-08 04:41:49
问题 I'm working on a laboratory practical with unit-testing, and below is a piece of code from the application that i'm testing. Most of the unit-testings are finished, but regarding the constructor below I just can't figure out how to test it. For example, what exactly is the constructor doing with the array elements? What would be a good way of testing the construtor? Is there maybe a kind soul out there who could give me a kick in the right direction? public struct Point { public int x, y;

Unit-testing of a constructor

老子叫甜甜 提交于 2021-02-08 04:41:01
问题 I'm working on a laboratory practical with unit-testing, and below is a piece of code from the application that i'm testing. Most of the unit-testings are finished, but regarding the constructor below I just can't figure out how to test it. For example, what exactly is the constructor doing with the array elements? What would be a good way of testing the construtor? Is there maybe a kind soul out there who could give me a kick in the right direction? public struct Point { public int x, y;

Cannot load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0' in MSTest project

有些话、适合烂在心里 提交于 2021-01-29 02:10:48
问题 I'm having problem with MSTest, Here the issue Open VS2019 Make sure that package management is set to [PackageReference] Create a .Net Framework test project Add Nuget package Microsoft.Extentions.Configuration last version (3.1.3.0) Add the code below Run test ==> Test fail with error [Cannot load file or assembly Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0 ...] error PS : using package.config instead of PackageReference solve the issue. Downgrading to Microsoft

Cannot load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0' in MSTest project

百般思念 提交于 2021-01-29 02:08:57
问题 I'm having problem with MSTest, Here the issue Open VS2019 Make sure that package management is set to [PackageReference] Create a .Net Framework test project Add Nuget package Microsoft.Extentions.Configuration last version (3.1.3.0) Add the code below Run test ==> Test fail with error [Cannot load file or assembly Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0 ...] error PS : using package.config instead of PackageReference solve the issue. Downgrading to Microsoft

C# out of scope objects not getting collected

余生颓废 提交于 2021-01-28 11:45:47
问题 I'm trying to build my first unit tests and have a class that increments and decrements an instance counter in it's constructor and destructor respectively. I have a test to make sure this works but it fails, it seems that other instances of the class from my other tests aren't having their destructor called when they go out of scope. public class Customer { public Customer() { ++InstanceCount; } public Customer(int customerId) { CustomerId = customerId; ++InstanceCount; } ~Customer() { -

How to run a list of tests with VsTest.Console

你离开我真会死。 提交于 2021-01-21 07:46:24
问题 How can I run a list of tests using vstest.console.exe? The .vsmdi format offered a way to specify test lists, but that format is deprecated(?). I can run an explicit list of tests on the command line, which essentially does exactly what I want, but if the number if tests is large (say a few hundred) then I will run out of command line space! vstest.console MyTests.dll /Tests:Test1,Test2 Is there no way that I can trick vstest.console.exe into running a list of tests defined in any other way?