Category Archives: visual studio

July, 2012

Run your favorite unit testing GUI directly from Visual Studio

Because it is easy and productive

If you are working a lot with unit tests and somehow are allergic to command line testing (I, for one, am) there is an easy way to configure your test project’s build to start your favorite’s library GUI automatically and load the test assembly into it.

This is very convenient and, as a bonus, allows you to set breakpoints in the test code, without having to attach to any processes.

Let’s have a quick look at how you can do that for xUnit and nUnit.

Continue reading

March, 2012

LINQ foreach iteration variable capturing and how it’s fixed in Visual Studio 11

Cause closures are confusing

A while a go, the C# community got surprised by another GOTCHA, discovering that using a foreach iteration variable inside a LINQ query, may not always yield the expected results. The variable gets captured by the foreach loop and, due to the evil work of closure, it remains scoped outside of the LINQ query itself living its own life so to speak. This has now been corrected in the Visual Studio 11 Beta.

Continue reading