Grouping and Filtering Tests in Visual Studio Test Explorer

One way to run automated tests is to use Visual Studio’s Test Explorer. Test Explorer can be found under the Test –> Windows –> Test Explorer menu items.

In this article we’ll look at how to manage the list of tests using grouping and also how to specify custom search filter expressions.

Two test projects in Visual Studio solution

Grouping Tests

There are a number of ways to group tests in Test Explorer, at the highest structural level we can group by project.

To select a group by method, click the drop down arrow as show in the following screenshot:

Selecting a grouping in Visual Studio Test Explorer

With the grouping set to Project, the test list looks as follows:

image

The next structural grouping is Class:

Grouping by test class

The final structural grouping is by Namespace:

Grouping by namespace

There are a number of non-structural groupings.

Group by Duration:

Group by duration

Group by Outcome:

Group by outcome

…and group by Traits:

Grouping by traits

Filtering Tests

Custom filters can also be applied.

For example by file path:

Filtering tests by file path

Other search examples include:

  • Trait:"Smoke Test"
  • Message:"System.Exception"
  • Class1
  • Outcome:"Passed"
  • Outcome:"Failed"

Subsets can also be excluded by prefixing the type of filter with a -. For example to show all tests in Class1 except failed tests: Class:"TestClass1" -Outcome:"Passed".

The Joys of Silence

I recently took possession of new desktop PC. As a Pluralsight author one of the unique considerations when choosing a new machine was generated noise. After some research I settled on sourcing the computer from a UK company called QuietPC.com.

NoFan PC case from front

Initially when I started researching what to buy I had assumed that I would pay some performance penalty as I wanted a CPU with fan-less cooling and I didn’t want the additional complexity of something like water cooling.

As the following image shows, I was able to get a quad core Skylake (Core i7 6700K 4.0GHz) without requiring a fan:

Nofan CR-95C Pearl Black IcePipe 95W Fanless CPU Cooler

The humongous thing in the preceding image is a Nofan CR-95C Pearl Black IcePipe 95W Fanless CPU Cooler. This fan-less CPU cooler is based on thermal heatpipes that are able to transfer heat away from the processor, the heat then being dissipated by the huge surface area of the “fins”.

Nofan CR-95C Pearl Black IcePipe 95W Fanless CPU Cooler

The case itself is a Nofan CS-80 Fanless Computer Case coupled with a Nofan P-500A Silent 500W Fanless 80+ GOLD PSU. The case features a vent at the top of the case above the CPU cooler to aid in convection.

In use, the PC is completely silent, no fan noise or electrical hum – the only noise emitted is if you are used the optical drive.

Prior to this machine I was using and was very happy with a Lenovo laptop though under load the fan noise was becoming a little distracting – in all fairness it was an aging machine that had been an 8 hour a day workhorse for a few years.

It’s amazing that once you’ve experienced the joy of completely silent computing, going back to using machines with fans seems archaic. No doubt we’ll eventually have silent, high-performance, fan-less laptops – though the small form factor will present some hard thermal dissipation challenges.

Full hardware specs:

  • Nofan CS-80 Fanless Computer Case
  • Gigabyte GA-Z170XP-SLI LGA1151 ATX Motherboard
  • Intel 6th Gen Core i7 6700K 4.0GHz 91W HD 530 8MB Quad Core CPU
  • Corsair DDR4 Vengeance LPX 32GB (2x16GB) 2400MHz Memory Kit
  • Nofan CR-95C Pearl Black IcePipe 95W Fanless CPU Cooler
  • Nofan P-500A Silent 500W Fanless 80+ GOLD PSU
  • Samsung 950 PRO M.2 512GB NVMe SSD
  • Samsung 850 EVO 250GB 2.5in Solid State Drive
  • Pioneer DVR-221LBK DVD and CD Reader/re-writer
  • Gigabyte Dual Band Wireless-AC GC-WB867D-I Wi-Fi/Bluetooth Card
  • Gigabyte GC-TPM Trusted Platform Module