3,692 questions
0 votes
0 answers
28 views
MSTest not properly discovering DataTestMethods when adding new folder to project
When attempting to add additional folders to my MSTest project and creating test class files within them that have tests that use the DataTestMethod tag with DataRow. Test explorer improperly ...
Advice
0 votes
1 replies
23 views
How do I convert a trx file into html in azure test pipeline
So how do I convert a TRX file into html in azure test pipeline. We have a selection of pipelines which run tests on a nightly basis. The tests are designed in Visual Studio with C#, Playwright, ...
-1 votes
2 answers
91 views
How to mock ILogger and invoke via callback Console.Writeline to have invocations in test explorer?
I need to have every invocation from the ILogger interface of a test, but I mock the ILogger interface in the class that is going to be tested, so it won't write to console and therefore the ILogger ...
1 vote
2 answers
220 views
Visual Studio Code Coverage Reports Not Listing Or Highlighting All Tested Code
using Visual Studio 17.14.18 I'm asking Visual Studio to give me a code coverage report, which it does. But there are lots of methods being used by the completed / passing tests that are not included ...
1 vote
1 answer
59 views
For MSTest.Sdk. v3.8.0 and above logs from another thread not assiged to correct test method
We use MsTest for integration testing involving communication with hardware, and in our case, multiple threads are needed. We do not require any parallel text execution, so all tests run sequentially. ...
0 votes
0 answers
52 views
Test Coverage Report including foreign namespace MSTest.Analyzers
I am currently loosing it about the attempt to generate test coverage reports for a current Corpo project. This worked flawlessly quite some time and is now running wild. The tests are done using ...
2 votes
1 answer
98 views
Visual Studio silently reverts mstest package versions
With Microsoft Visual Studio Community 2022, Version 17.14.12 VisualStudio.17.Release/17.14.12+36408.4 Microsoft .NET Framework Version 4.8.09032 and this simple mstest project content: <Project ...
0 votes
1 answer
25 views
Can not instantiate proxy of class Could not find a constructor that would match given arguments
When mocking like this: transmissionsRepository = new Mock<TransmissionsRepository>(transmissionsContext, httpContextAccessor.Object, transLogger.Object); controller = new UtilityController(...
0 votes
1 answer
84 views
Use MSTest.Sdk for TestHelper
I just ported all our test projects to MSTest.Sdk But now I wonder how to deal with the TestHelperProject (This is a project providing Assert-Helpers, Config-Helper etc for the tests) so it is not a ...
0 votes
1 answer
113 views
System.ArrayTypeMismatchException when using System.Text.Json with .NET Framework 4.7 in MSTest
I'm currently using .NET Framework 4.7 along with MSTest (all packages are up to date). I'm trying to deserialize a JSON string using System.Text.Json as shown here: using System.Text.Json; private ...
2 votes
1 answer
97 views
TransactionScope lost on making TestInitialize async
For a project I'm working on, I'd like to insert testdata before every test and then rollback the transaction for the next test to start with a clean slate. The skeleton code below works fine for that:...
0 votes
1 answer
82 views
How to isolate C# unit tests with global resources
Each unit test is supposed to be self contained, but unless we had some way of killing the entire process for each test, there is no way in .NET to guarantee another test hasn't done anything that ...
-1 votes
1 answer
65 views
How to clean up for each TestMethod in unit test MSTest?
The method marked with [TestCleanup] will be run after test methods marked the [TestMethod]. But I want to run different clean-up logic for each test methods. How to do that?
0 votes
1 answer
62 views
How do I write Visual Studio testlog during Azure Pipeline and save as a artifact
So we have numerous pipelines that run Selenium or Playwright tests overnight. The test suites are built using C# with selenium or Playwright and MsTest. The end result does not display the actual ...
1 vote
1 answer
174 views
testhost.exe doesn't see Microsoft.Android Framework?
I'm upgrading a Xamarin Forms project to MAUI taking the projects to .NET 8 and everything seems to be working alright until I try and run tests. The app works and all of my tests show in the Test ...