.NET 3.5


MSTest = Fail

One of my current clients is really embracing all the MS clones of great open source tools like MSTest, Team Build, Entity Framework, etc. Although I love the open source tools like nUnit, Team City (ok not so open source but still free), and nHibernate, I thought I would try MS Test out even though I have not heard many good things about them. First I will say something nice: MSTest has a nice code coverage suite. I really like that it is integrated with visual studio and can even highlight the areas that are covered and not covered which is the...

Extension Methods For Casting

I have not played much with orcas or .NET 3.5 but had an interesting idea so had to crack and get it up and running. One thing I have not liked is having to cast/parse types as it leads to harder to read code in some situations . i.e.:int myInt = int.Parse(((customer)value).SocialInsuranceNumber)ordim myInt as integer = integer.Parse(ctype(value, customer).SocialInsuranceNumber) So playing around with extension methods I got code like this that is a bit more fluent:int myInt = value.CastTo<customer>().SocialInsuranceNumber.Parse<int>();I find this a lot more readable. Here is the code: public static class CastExtension    {        public static T CastTo<T>(this object value)        {            if (value...