Sunday, 22 March 2009

Integrating PartCover with Visual Studio 2008

One of essential tools in the software development is code coverage. Together with unit testing tools like NUnit it is easy to see how much of the code is covered by tests. Ideally Developer need to aim for 100% of code coverage when creating Unit Tests. This tutorial will use one of my software projects Windows Environment Variables Manager or EnvMan as an example.  On EnvMan website you can find another post that shows integration of PartCover with Visual Studio 2005. Technically there is no much difference between Visual Studio 2005 and 2008, this post covers version 2.2.0 of the PartCover and shows updated batch script as latest version of the PartCover required some changes to it.

PartCover.cmd

As first step we need to download and install latest version of the PartCover. It is available from SourceForge site. Once installed we need to create PartCover.cmd batch file.

REM === Start PartCover.cmd ===
"C:\Path\To\PartCover\partcover.exe"--target "C:\Path\To\NUnit\nunit-console.exe"--target-work-dir %1 --target-args %2 --output %1\partcover.xml --include %3

"C:\Path\To\PartCover\PartCover.Browser.exe" %1\partcover.xml
REM === End PartCover.cmd ===

Integrating PartCover with Visual Studio 2008

To integrate PartCover with Visual Studio select menu Tools\External Tools ...

In the External Tools Dialog box click Add and enter the following data in the fields.

Title:

Part Cover

Command:

C:\Path\To\PartCover\PartCover.cmd

Arguments:

$(ProjectDir)\bin\Debug $(ProjectDir)\bin\Debug\$(TargetName)$(TargetExt) [*Assembly Regular Expression*]*

Initial Directory:

$(ProjectDir)\bin\Debug

Tick Use output Window and Prompt for Arguments. Click OK

Running PartCover

To run PartCover select EnvManagerTest project and use Part Cover from Tools menu. Because we ticked "Prompt for Arguments" the following dialog box appears.

Replace "Assembly Regular Expression" with "EnvMan" so it looks like this [*EnvMan*]*. Please look at PartCover documentation for more details about regular expressions. After OK is clicked output window of Visual Studio will show a progress of the coverage test and Part Cover Code Browser window will appear. Unfortunately PartCover Code Browser does not open generated report file automatically. Use Open File menu to view generated partcover.xml report file.

Saturday, 21 March 2009

Free Icon Collections

Recently I was looking for free icons I could use for my web and desktop application development and came across few sites. Below is a list of links and references that might be very useful.

Application Icons

Sweetie - Cute and clear icons

Sizcons - A nice and useful set of icons to customize your applications

ASP.NET Icons - 300 professionally designed icons for your ASP.NET applications

Animated GIFs

Activity indicators - Link1, Link2, Link3

Free Internet Icon Search Services

ICONLook - Search Icons on Internet

IconFinder - ICON Search made easy

IconLet - ICON Search

Icon Search Engine - Search ICONs on Internet

References

For these who likes to see more follow the links below.

Free 40 Icon Sets

Pinvoke

20 Free and Fresh Icon Sets

Icons for your Desktop and Web Designs

Free Icon Web 35 Free Icon Sets

Icons Free

Icon Archive

Icon BAZAAR

Free Icons, Buttons and Templates

Icons Review Open Clipart

55 Free High Quality Icon Sets