Tagged: Visual Studio

Unit Testing Improvements in Visual Studio 2011

In the past, one big reason why people did not embrace MS Test (I think) is because Visual Studio 2008/2010 did not provide a good environment that supported Unit Testing. Sure it did had MS Test and its runner, but it was weak compared to Test Runner from Jet Brains ReShareper or TestDriven.net. I think someone at Microsoft listened to and as I result, there is many notable improvements in this area in Visual Studio 2011.

Below screenshot shows Visual Studio 2011 with Unit Testing related Menu marked.
Under Run Unit Tests, options are all self explanatory.

Menus shown below:

There is an option Unit Test > Unit Test Setting called “Run Tests after Build”, using by which you can always run all the unit tests after each time you build. This is a good practice, and if you manage it well i could be useful. Personally I think I would always kick off my test/s manually, its just my preference now. Also I would have a well scripted local build that can take care of building all components and running my unit and integration tests automatically.

BYO TF (Bring your own Test Framework)

I am not a fan of Ms Test (I think I made that clear earlier), I use NUnit and I have no idea to switch to another framework. What I like about this edition of Visual Studio, is that, it supports other testing frameworks like NUnit through test adapters. If you are using NUnit like me, download NUnit Test Adapter from here > Link
Visit this page for information on all available at this time > Link

Another way of getting third party frameworks is to use the Extension Manager, Click on Tools > Extension Manager to launch extension manager, then under Online Extensions, Expand Visual Studio Gallary, Select Tools, and click on Testing.

Test Explorer

Test Explorer lists all the Tests grouped by Failed, Passed, etc. You can right click and run individual tests, or debug tests.

Code Coverage

Visual Studio 2011 packs a code coverage tool also. This is a great feature addition. In the past, I had to purchase a tool like dotCover to do this for me. By double clicking on each line in the coverage results window, you can inspect the parts of your code that lacks coverage (or be proud to see every piece of code has 100% coverage and green)

More later, Happy Coding

Good collection of Visual Studio/ASP.net/IIS tips

Visual Studio 2010 – Peek into Future

VS.net project, accessing from Network Share !

Level: Intermediate

If you place your VS.Net projects (Windows App) in a network share and try to work off that share, you might end up with an error message like this “The project location is not fully trusted by the .NET runtime”. This message pops up when you try to open the project file. If you say Ok, to that “long” message and continue working you might end up with some security permissions issue when you try to debug. (In my case, I was trying to open a file using StremReader and it threw an Security Exception !)

In order to successfully run the projects, you will need to play around a bit with .Net configuration tool. Launch mscorcfg.msc (you should be able to find this under your current version of .Net Framework dir)

Under My Computer > Runtime Security Policy, you can either add a new code group and give “Full Trust” permission for the URL(File/Http) or you can use the adjust the security policy link, give Full Trust to Local Intranet.

Try one or the other and see what works for you !