If you are writing unit tests using MSTest then be aware of the Assert.Equals method as shown here:

Assert.Equals(string1, string2);

Instead of using the .Equals() method you should actually be using

Assert.AreEqual(string1, string2);

- OR -

StringAssert.Equals(string1, string2);

The problem is that Assert.Equals is just the inherited Object.Equals method. It does nothing but compare object equality (not value equality) and return a true or false value instead of breaking the unit test if the items are not equal.  Because the true/false return value is ignored nothing untoward will happen and the unit test will continue through giving us a false sense of security that our unit test is passing.

This is a common mistake for those of us who are used to NUnit testing as the original line is a correct assert under NUnit.

The good news is that for those using VS2008, you don’t have to worry as much since using Assert.Equals will fail any unit test it's used in:

clip7