In my business, I am working on Unit Testing, after finishing an example in a .NET application. We want to use a standard .NET Unit Testing project. 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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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
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.
Let us know if this was helpful.
If you are interested in Serialization, Kern Nightingale has got a perfect presentation which will give you insight to how to use it for testing as well.
Finally 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.