public void SetUp() { // you have to be an administrator to access the CMS controller Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("admin"), new[] { "Administrator" }); contentRepository = MockRepository.GenerateStub<IRepository<Content>>(); menuRepository = MockRepository.GenerateStub<IRepository<Menu>>(); contentOrderableService = MockRepository.GenerateStub<IOrderableService<Content>>(); cmsController = new CmsController( contentRepository, menuRepository, contentOrderableService); }
public void SetUp() { // you have to be an administrator to access the CMS controller Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("admin"), new string[] { "Administrator" }); contentRepository = MockRepository.GenerateStub<IRepository<Content>>(); contentOrderableService = MockRepository.GenerateStub<IOrderableService<Content>>(); validatingBinder = new ValidatingBinder(new SimplePropertyBinder()); cmsController = new CmsController( contentRepository, contentOrderableService, validatingBinder); }