Writing well tested and reliable code should be the aim of every developer who works with Episerver. This section covers some of the techniques to write unit tests within Episerver.
This is the second part of my unit testing series. In Unit Testing Part 1 I discussed simple ways that you can organise your project so all the Episerver API dependencies are hidden away in a single file to help improve your sites testability. As of[...]
This is the third post in my unit testing series. So far we have created a single Epi Dependencies class to manage ll or Epi Servers API in a single place. In the second post, we created some basic unit tests using Moq to mock up these dependencies[...]
If you want to unit test your controllers at some stage, you'll want to test your Action Results. In Epi-Server, it is very likely you may want to Redirect to another episerver page from an MVC controller, e.g. a redirect to [...]
This might be a bit of a painful post for some people. Episerver CMS has made amazing progress in the last few years towards creating a platform that is very easy to unit test. Episerver commerce is making baby steps towards this goal as well, but [...]
Mocking the Content Repository
One of the most useful unit testing tools available to you as a developer is Moq. Moq is a lightweight mocking framework that will allow you to get a lot more test coverage in your projects. If you have never used a m[...]