Browse by Tags

All Tags » Code Snippets (RSS)

Google Code Search

At the moment Google appears to be spidering CVS repositories and archives (ZIP files etc.) It surely won't be long before Subversion is included in that list since that is what Google Project Hosting uses! Lots more info on Google Blogscoped including...
Posted by Jamie Cansdale | 17 comment(s)
Filed under: , ,

Testing Internal Methods

Over on the Windojitsu blog, Shawn has come up with a minimalist alternative to NUnit. The main reason given is not wanting to inflict a dependency on anyone who wants to build his project. TestDriven.NET already supports the idea of light weight testing...

((ArrayList)list).Sort();

Within minutes of posting a link to Code Blog , someone submitted the following solution ... public IList Sort(IList list) { ((ArrayList)list).Sort(); return list; } This is certainly the simplest possible solution to the problem (in true XP style). But...

Code Blog

I've just uploaded a set of unit tests for a sorting algorithm. Anyone is welcome to flesh out the failing stup implementation and make the tests pass. You can compile the code and run the tests online . Once all tests pass you are free to give your submission...

Comment Spam

I may have just stumbled accross a solution for comment spam. You can comment , but only when it builds and all tests pass... ;o)

Who Needs VB.NET Macros?

Prototyping addins can be frustrating. If you don't fancy learning VB.NET just to write macros, you're forced to work with a full blown addin. This is anoying if all you want is a quick spelunk inside the VS automation model . This is why I've added another...

Code 2 Html

Nauman Leghari writes "I am looking for an addin which can convert code to html from the VS.NET IDE". I've been thinking about this recently too. It would be easy to adapt the NUnitAddin code to do this. Look for AddControl("Code Window", 3) in the source...
Posted by Jamie Cansdale | 1 comment(s)
Filed under:

Command Line Parsing with XmlSerializer

Duncan Mackenzie commented about a command line switch parser he found. Has anyone thought of doing command line parsing using (my current favorite class) the XmlSerializer? The code that follows can handle strings, ints, uints, bools, enums and arrays...

Immediate - Ad Hoc Tests

Okay, as promised I've implemented Ad Hoc tests in the latest build. The idea is to allow any method to be used as an Ad Hoc test. If the class the method belongs to implements a constructor or the IDisposable interface, these will be used to set up and...
Posted by Jamie Cansdale | with no comments

Enumerating AppDomains

Have you ever wondered how to enumerate all AppDomains in the current process? It can be done with a little COM interop... // Add the following as a COM reference... // C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\mscoree.tlb using System; using System...
Posted by Jamie Cansdale | 3 comment(s)
Filed under:
More Posts