Wednesday, October 29th, 2008

Type Mock embraces SharePoint



TypeMock have recently made some updates to their site and have started to pull together information around testing SharePoint. I’m really getting to like the new AAA (Arrange, Act, Assert) approach that they are building into the product from version 5 onwards.

 Gil Zilberfeld post a great example of this by refactoring the work that was done on the SharePoint Patterns and Practices project using the (coming very soon update to TypeMock).   Although I like Natural Mocks it tended to make the tests quite long and very brittle, using the new AAA syntax this becomes so much more cleaner.

Members.ReturnRecursiveFakes seems to be where all the magic exists.    Previously you would have to write stub code for everything your method touched on the objects, which made the tests very brittle, now using the Recursive Fakes approach you only need to stub out the methods that you want to validate.

Roy Osherove manages to explain this in a very easy to understand way.

blog comments powered by Disqus