How do I enforce exception message with ExpectedException attribute

We use this attribute all over the place and we clearly misunderstood the second parameter (shame on us). However, we definitely have used it to check the exception message. The following was what we used with hints from this page. It doesn’t handle globalization, or inherited exception types, but it does what we need. Again, … Read more

Forcing MSTest to use a single thread

I solved this problem with locking: public static class IntegrationTestsSynchronization { public static readonly object LockObject = new object(); } [TestClass] public class ATestCaseClass { [TestInitialize] public void TestInitialize() { Monitor.Enter(IntegrationTestsSynchronization.LockObject); } [TestCleanup] public void TestCleanup() { Monitor.Exit(IntegrationTestsSynchronization.LockObject); } //test methods } // possibly other test cases This can of course be extracted to a … Read more

How to exclude certain tests in the Visual Studio Test Runner?

TL;DR version: Other answers have commented on workarounds and use of the more recent Traits options. However, none quite tell you how to specifically exclude tests for a trait. To do so, simply use a – (minus) to negate a filter in the search box, e.g.: -Trait:”DatabaseIntegration” This will exclude all tests with that trait. … Read more

Difference between Microsoft.VisualStudio.TestPlatform.TestFramework and Microsoft.VisualStudio.QualityTools.UnitTestFramework

MSTest has been released as a new NuGet package solution that is no longer tightly coupled to the Visual Studio version. Your new projects are using MSTest 2.0. MSTest V2 release annoucement: https://devblogs.microsoft.com/devops/taking-the-mstest-framework-forward-with-mstest-v2/

techhipbettruvabetnorabahisbahis forumuedueduedusedusedueduseduedusedusedus