Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play sound after running unit tests in Visual Studio

When I am developing on my local machine, I want Visual Studio to play a happy sound when I run my unit tests and they pass and a sad sound when one fails and a really sad one when more than one fails. How do I do this?

I assume that I need to write a macro, but I can't find any environment events that relate to unit tests. I am using Visual Studio 2010, but it would be nice to have a general solution for most or all versions of Visual Studio.

like image 998
TallGuy Avatar asked Sep 06 '10 22:09

TallGuy


1 Answers

I use a Visual Studio extension called "Ding". It will let you assign a sound to: build completed, breakpoint hit, unit test - success, and unit test - failure.

I use only the unit test events with Ding. I have the "build failed" and "build succeeded" events assigned using the normal Windows program events described by @gerdi above. Ding doesn't differentiate between 1 test failed and many failing.

I don't really find the sounds annoying as I have about 25 projects in my Solution and over 800 unit tests, so I do have a little time to look at other tasks before the sound goes off which is my whole idea for having sounds. Of course, a short power nap wouldn't be out of the question either (LOL). And, yes -- I do work alone.

More info on Ding

like image 88
RandyB Avatar answered Oct 26 '22 17:10

RandyB