I was helping a customer recently to improve the way they do testing and I looked at one of their tests as follows:

[TestMethod]
public void FeedFileProcessorResolvesLoadDirectoryViaFeedType()
{
MockRepository mocks = new MockRepository();
using (MockServices services = new MockServices(mocks))
{
FeedType feedType = MockServices.CreateStubFeedType(1001, null, null, @"z:\PickUpDirectory");
Expect.Call(services.FeedTypeProvider.GetByFeedTypeID(feedType.FeedTypeID))
.Return(feedType);
mocks.ReplayAll();

MockFeedFileProcessor.DefaultFeedTypeId = 1001;
FeedFileProcessor processor = new MockFeedFileProcessor();
string loadFilesFrom = processor.DirectoryToLoadFilesFrom.FullName;

mocks.VerifyAll();

Assert.AreEqual(@"z:\PickUpDirectory", loadFilesFrom);
}
}

On first glance it seems reasonable.  The test is named so that it describes what it does and seems to work through checking that the object behaves as it should. Sure the Rhino Mocks syntax could be updated to use AAA syntax, and the using section doesn't really indicate what's going on under the hood there but apart from that it doesn’t look too bad.

Look a little closer though and check out the class under test and you may see a small problem.  That’s right, the only class being tested here is the mock itself.  Not something that you really want to do.

By not actually testing a class from our production code we’ve made the test have zero value for the system itself.