public void DemoContent_RenderingContextItemNotInitialized_ShouldThrowException(IContactProfileProvider contact, IProfileProvider profile, ITracker tracker) { //arrange var controller = new DemoController(contact, profile); var context = new RenderingContext(); ContextService.Get().Push(context); using (new TrackerSwitcher(tracker)) { controller.Invoking(x => x.DemoContent()).ShouldThrow<InvalidDataSourceItemException>(); } }
public void DemoContent_RenderingContextNotDerivedFromSpecificTemplate_ShouldThrowException([Content]Item ctxItem, IContactProfileProvider contact, IProfileProvider profile, ITracker tracker) { //arrange var controller = new DemoController(contact, profile); var context = new RenderingContext(); context.ContextItem = ctxItem; ContextService.Get().Push(context); using (new TrackerSwitcher(tracker)) { controller.Invoking(x => x.DemoContent()).ShouldThrow<InvalidDataSourceItemException>(); } }