NUnit - ExpectedException with Custom Exception

While the NUnit docs give a good example of how to test for system exception types, it leaves you hanging on how to capture the custom exceptions that you are throwing. For instance, you might do something like:

throw new Exception("SSN should be formatted 123456789");

How do you set up your test attributes for this exception?

In VB:

<Test(), ExpectedException(GetType(Exception), "SSN should be formatted 123456789")>
        Public Sub ValidateSSNFormat()
        ' code that will cause the routine to throw the expected exception

In C#:

[ExpectedException(typeof(Exception),"SSN should be formatted 123456789")]
public void ValidateSSNFormat()
// code that will cause the routine to throw the expected exception


Have you been thinking about learning to play flute but the cost of purchasing a flute has been holding you back. Well if you're a do-it-yourselfer check out Mark Shep's website and book. Following Mark's instructions I was able to build a PVC flute in no time at all. I've been having some fun playing with it. Next week I'll build one from CPVC.

RSS Bandit

Well, after the issues I had with NewsGator I explored some other news aggregators. I used Attensa for a while now and have been fairly happy with it. However, it is tied to a single machine. Then a recent update broke it and after several attempts at figuring it out and getting it going again, it was just easiest to drop it. I tried the NewsMonster aggregator that works (s'posedly) with FireFox but no go. It wouldn't install and work correctly. I did check out some of the RSS readers on but had some issues with one that appealed to me. So, now I'm using RSS Bandit. Having it not tied in to Outlook has actually been a good thing. It has a handy configurable synch feature. I used it to save settings/state to a flash drive. Then when I got home, I installed RSS Bandit on the home machine and downloaded from the flash drive. RSS Bandit went out to the web and pulled the content. I was good to go. Ironically, I should be able to synch with NewsGator OnLine too. Since I've already paid for that, I might give it a go.