Over the last few weeks I have been exploring different frameworks and tools available for writing unit tests in Sitefinity. Surprisingly, documentation and examples of unit testing Sitefinity are a little light. Sitefinity.com has a couple blog posts on the subject but they don’t exactly provide a quick start on how to unit test a specific piece of custom functionality. Fortunately, Telerik provides its own standalone mocking framework, JustMock, which developers can use to get Sitefinity functionality mocked and tested in an afternoon (one thing to note, this post uses the commercial version of JustMock, which has more features and functionality than JustMock Lite). Since unit testing is a pretty large topic requiring some set up, I will be breaking this post into two parts. First, I will cover how to setup a Sitefinity project for unit testing. Next, I’ll cover a simple test implementation. The end goal is to provide a step-by-step guide for creating a unit test in Sitefinity. Before I get started, I’ll cover some key terms relating to unit testing.
Read More