Showing posts with label MSTest. Show all posts
Showing posts with label MSTest. Show all posts

Friday, 4 May 2012

TestDriven.Net does not require [TestMethod]

Just found out something interesting about TestDriven.Net. It allows you to run code logic as a test, even when the [TestMethod] attribute is not on the method you're testing.

However don't try doing this with an client side integration test, as you'll just get an endpoint not set in code exception!

Friday, 16 March 2012

Visual Studio Slow when connecting to test results (.trx)

Just found this worked for me, when connecting to test runs...

http://blogs.msdn.com/b/lkruger/archive/2008/06/03/slow-performance-in-visual-studio-2008-ide-after-opening-test-project.aspx

Disable background discovery of test methods: (Available in VS2008 SP1 only)

1. Select the Tools | Options | Test Tools | Test Project menu option.

2. On the Test Project dialog (figure 1.1), select the “Disable background discover of test methods” checkbox option and press ok.

This will disable the background discovery of test methods and will dramatically speed up the IDE. However, since this is global option, this will disable the test method discovery on every project. If you wish to re-enable the discovery, simply load the Test Project dialog again and deselect the “Disable background discover of test methods” checkbox.

 

Also, another tip is to set the option "Double-clicking a failed or inconclusive unit test result displays the point of failure in the test"

image

Monday, 25 July 2011

How to get your unit tests (test project in Visual Studio 2008, a.k.a. MSTest) run multithreaded

 

Add this to the configuration for the test

<TestRunConfiguration ...>

...

<ExecutionThread apartmentState="MTA" />

</TestRunConfiguration>

To check the threading model used, add the following line to your test(s):

[TestMethod]

public void YourTest()

{

System.Diagnostics.Debug.WriteLine(System.Threading.Thread.CurrentThread.GetApartmentState().ToString());

// TODO: Add test logic here

}

http://blogs.msdn.com/b/irenak/archive/2008/02/22/sysk-365-how-to-get-your-unit-tests-test-project-in-visual-studio-2008-a-k-a-mstest-run-multithreaded.aspx

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...