How to Unit Test a GlassController Action which Uses Sitecore.Context.Item
问题 I'm a sitecore developer and I want to create a sample sitecore helix unit testing project for testing out the logic you see in our "ArticleController" controller's Index() action method: public class ArticleController : GlassController { public override ActionResult Index() { // If a redirect has been configured for this Article, then redirect to new location. if (Sitecore.Context.Item.Fields[SitecoreFieldIds.WTW_REDIRECT_TO] != null && !string.IsNullOrEmpty(Sitecore.Context.Item.Fields