示例#1
0
        public void StartWithEpiserverEngineFirstIteration_IContentRepositoryIsNotNull()
        {
            var engine = new EpiserverEngineFirstIteration();

            engine.Start();

            IContentRepository repository = ServiceLocator.Current.GetInstance <IContentRepository>();

            Assert.NotNull(repository);

            engine.Stop();
        }
示例#2
0
        public void StartWithEpiserverEngineFirstIteration_CreateStartPage_SinglePageExists()
        {
            var engine = new EpiserverEngineFirstIteration();

            engine.Start();

            IContentRepository repository = ServiceLocator.Current.GetInstance <IContentRepository>();

            var startPage = repository.GetDefault <StartPage>(ContentReference.RootPage);

            startPage.Name         = "Start";
            startPage.Heading      = "Welcome to Lorem";
            startPage.StartPublish = DateTime.Now;

            repository.Save(startPage, SaveAction.Publish, AccessLevel.NoAccess);

            var pages = repository.GetChildren <StartPage>(ContentReference.RootPage);

            Assert.Single(pages);

            engine.Stop();
        }
示例#3
0
        public void StartWithEpiserverEngineFirstIteration_RunMultipleTimes_SinglePageExists(int _)
        {
            var engine = new EpiserverEngineFirstIteration();

            engine.Start();

            CreateUser("Administrator", "Administrator", "*****@*****.**");

            IContentRepository repository = ServiceLocator.Current.GetInstance <IContentRepository>();

            var startPage = repository.GetDefault <StartPage>(ContentReference.RootPage);

            startPage.Name         = "Start";
            startPage.Heading      = "Welcome to Lorem";
            startPage.StartPublish = DateTime.Now;

            repository.Save(startPage, SaveAction.Publish, AccessLevel.NoAccess);

            var pages = repository.GetChildren <StartPage>(ContentReference.RootPage);

            Assert.Single(pages);

            engine.Stop();
        }