A while ago I came across this question on StackOverflow – Unit Testing Sitecore using NUnit, serializing content
I was lucky to successfully answer the question and provide information to the user dpwulp94 and also hope that this answer provided was helpful to other seekers as well.
My effort for this blog post is to put the information together in one place and update it periodically.
Anyone seeking Unit Testing in Sitecore should watch the below videos and there are plenty of others as well.
Interesting videos on Youtube
- Sitecore Unit Testing video by gravypower.
- Another interesting video by codeflood.
- Most knowledgeable for me was this video by Alistair Deneys from Hedgehog
- Advanced Glass Walkthrough video by Mike Edwards from Hedgehog
- Automated Testing with Sitecore V2 video by Alistair Deneys from Hedgehog
Other interesting blogs are
- Igloo – Unit Testing for Sitecore
- iStern – Unit testing with Sitecore Item by Thomas Stern
- Mocking Sitecore with MS Fakes Part I and Part II by Thomas Stern
- And lastly my preferred Coffee => Coder => Code again by Alistair Deneys
- Knifecore’s blog also helped me a lot when I was trying to write tests.
- Unit Testing with Sitecore by Reservoir Devs
The topic of Serializing Sitecore objects was also mentioned
“We also want to mock the Sitecore data by serializing the Sitecore objects. I have been looking for, but could not find a good tutorial to do this. How can I do this?”
Would also recommend Sitecore Glimpse by Kevin Obee, the project’s one of the purpose is “provide build scripts that automate the tasks of compiling, testing and packaging the project artifacts to make it easier to open the project up for collaborative development” which he mentions on his blog.
To conclude hope this gives bit more perspective on Unit Testing and Serialization with Sitecore.