Month: March 2017

Complete Unit Testing In Sitecore

Unit testing is Sitecore can be tricky. There are a lots of moving parts. And to truly be able to test, you need to somehow bring all of those parts into a test.

Unit testing could be divided into two different type: regular Unit Tests (just to test BusinessLogic without data relations) and Integration Unit Tests.

In the current article I will focus on Integration Unit Tests. In the futher articles I will describe how to write UnitTests without strong coherence with Sitecore.

So, to accomplish the main goal and have working UnitTests I will try to do the following:

  • Execute unit tests within a valid Sitecore context
  • Load all current App_Config/Include/ configs at runtime
  • Access to all APIs
  • Maintain to additional config files
  • No scripting involved

According to our goals let’s find a way of how to reach it. It’s mostly screenshots and code samples anyways.

Continue reading “Complete Unit Testing In Sitecore”

Sitecore Content and Page Editor: Injecting of resources

Image, that there is a need to add some external script inside Content Editor or/and PageEditor. What do you do? Might be you would start with developing of a custom field type that requires Google Maps API. Maybe many of your renderings use an external library or a client side helper of your own when in IsPageEditorEditing(). Whatever the case might be you may want to inject resources into your Content and Page Editor environments and do it once globally. And in a declarative way. This blog post will explain you the exact way of how to do it.

Continue reading “Sitecore Content and Page Editor: Injecting of resources”