Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Tuesday, September 21, 2021

Friday, November 18, 2011

Code coverage info from NUnit into Visual Studio

Use NCover or dotCover you might say. And you would be right.

But for the current project I was looking for a free solution. I started to google the web for a free alternative and found PartCover, OpenCover and this article.

PartCover and OpenCover does noe have any GUI or plugin in Visual Studio, so when I saw that it was possible to use the same window in VS as MSTest I was sold.

Run the following command in the visual studio prompt. (Add the correct paths and dlls for your system)

vsinstr -coverage MyLibrary.dll
start vsperfmon -coverage -output:mytestrun.coverage
nunit-console.exe /noshadow UnitTests.dll
vsperfcmd -shutdown
Whats happening here is that we are first adding instrumentation to the dll. Then we are starting the vsperfmon service to listen to whats beeing executed. Execute the test runner and shutdown the vsperfmon service.
Then open the mytestrun.coverage file in Visual Studio. Voila..

The Test coverage is displayed with the information.
I guess the only catch is that you need Team System Tools for this to work.
Off course you need to manually set this up. Hmm maybe I should write a Visual Studio plugin..

Share:

Thursday, November 4, 2010

XmlTidy

Needed a tool to tidy some Xml in "Programmer's Notepad" and could not resist to created my own version of XmlTidy. :-)

using System;
using System.Xml;
using System.Xml.XPath;

namespace XmlTidy
{
    public class Program
    {
        private enum ExitCodes
        {
            Success = 0,
            Failure = 1
        }

        private static int Main(string[] args)
        {
            if (args.Length == 0)
            {
                return ShowUsage();
            }

            var inputFile = args[0];
            var outputFile = args.Length == 1 ? args[0] : args[1];
            return Tidy(inputFile, outputFile);
        }

        private static int ShowUsage()
        {
            Console.WriteLine("Usage: XmlTidy <inputfile> <outputfile>");
            Console.WriteLine("if <outputfile> is not specified, the <inputfile> is overwritten.");
            return (int)ExitCodes.Success;
        }

        private static int Tidy(string inputFile, string outputFile)
        {
            var result = (int)ExitCodes.Success;
            try
            {
                var document = new XPathDocument(inputFile);
                var settings = new XmlWriterSettings { IndentChars = "\t", Indent = true };
                var writer = XmlWriter.Create(outputFile, settings);
                document.CreateNavigator().WriteSubtree(writer);
                writer.Close();
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                result = (int)ExitCodes.Failure;
            }

            return result;
        }
    }
}

Share:

Wednesday, November 3, 2010

Programmer's Notepad

Got a new laptop today and have started to install all the cool and useful tools I need. Previously I have used TextPad and Notepad++ as my notepad replacements, but this time I decided to see if there was some other text editors out there. Found "Programmer's Notepad" that looks promising. I looks simple and clean, but yet powerful.
Share:

Tuesday, October 19, 2010

Creating a self-signed certificate with private key

Needed to make a self-signed certificate with a private key for a project I working on. After some research I found that the combination of makecert and pvk2pfx did the trick. Use the following commands in Visual Studio Command Prompt
makecert -r -pe -n "CN=Test" -b 01/01/2010 -e 01/01/2020 -sky exchange Test.cer -sv Test.pvk
pvk2pfx.exe -pvk Test.pvk -spc Test.cer -pfx Test.pfx
When executing the commands above you will be asked for some information like password etc. After you are finished the file Test.pfx includes a self-signed certificate with the a private key.
Share:

Monday, June 7, 2010

AD LDS for Windows 7

On XP machines there was a a service called ADAM that could be used when you needed a lightweight ActiveDirectory. This was extremely useful when developing applications that used AD. You could test your application without the need to modify your client/company AD.

But this service was not supported in Vista or Win7.

But now Microsoft have released AD LDS for Win7 that can be downloaded here:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a45059af-47a8-4c96-afe3-93dab7b5b658
Share:

Wednesday, January 27, 2010

SMTP server for development purposes

Needed to test some code sending emails, but did not find the local SMTP sever on Windows 7.

Did a quick search and found this one.. sweet..

http://smtp4dev.codeplex.com/

Dummy SMTP server that sits in the system tray and does not deliver the received messages. The received messages can be quickly viewed, saved and the source/structure inspected. Useful for testing/debugging software that generates email.
Share:

Tuesday, December 8, 2009

Testing Internet explorer

IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8, IE7 IE 6 and IE5.5 on Windows 7, Vista and XP, as well as the installed IE in the same process.

Great tool for testing websites in different versions of Internet Explorer
Share:

Monday, December 7, 2009

Convert old harddrive to VHD

I recently upgraded to Win7 on my laptop, but I still needed my old environment (WinXP).

So I installed Win7 on a fresh new disk that was bigger and better than my old. That way I always could swap disk if I needed my old environment. But I also was hoping for a solution where I could run my old system inside Virtual PC, and now it is.

I used the tool Disk2vhd from Microsoft Sysinternals.

For WinXP remember to set “Fix up HAL for Virtual pc”.

When its finished, you need to create a new Virtual PC and used the newly created vhd file as its harddrive. You also will need to activate windows once more when you startup. At least I had to.
Share:

Wednesday, December 2, 2009

Remote Desktop Manager

Remote Desktop Manager is a small application used to manage all your remote connections and virtual machines. Add, edit, delete, shared, organize and find your remote connection quickly. Compatible with Microsoft Remote Desktop, Terminal Services, VNC, LogMeIn, Team Viewer, Ftp, SSH, Telnet, Dameware, X Window, VMWare, Virtual PC, PC Anywhere, Hyper-V, Citrix, Radmin, Microsoft Remote Assistance, Sun Virtual Box and more.


http://remotedesktopmanager.com
Share: