Fake DB

PageContext item in Sitecore Fake DB + Unit test cases

I tried to set PageContext using  RenderingContext.EnterContext but didn’t work using (RenderingContext.EnterContext(new Rendering(), contextItem)) { I have set it using  ContextService.Get().Push(pageContext); Here is the code, which may help you using (Db db = new Db using (Db db = new Db { { new DbItem(“Test Item”, ID.NewID, ID.NewID) { new DbField(“Sample Field”) Read more…

By Praveen, ago