예제 #1
0
        public MultistepActionStepResult Step(int step)
        {
            var result         = new MultistepActionStepResult();
            var templateNumber = step * ItemsPerStep + 1;

            result.ProcessedItemsCount = PageTemplateService.CopySiteTemplates(SiteId, NewSiteId.Value, templateNumber);
            return(result);
        }
예제 #2
0
        public void Delete_DeletesAnyPropertiesThatBelongToThePageNode()
        {
            //arrange
            var sectionTemplate   = SectionTemplateService.Create("Foobar");
            var sectionNode       = SectionNodeService.CreateSectionNode(sectionTemplate.Id, "Foobar", "foobar");
            var pageTemplate      = PageTemplateService.CreateForSectionTemplate(sectionTemplate.Id, "Foobar", "FoobarModel");
            var propertyTemplate1 = PropertyTemplateService.Create(pageTemplate.Id, "Foobar1", CmsPropertyType.ImagePicker, null);
            var propertyTemplate2 = PropertyTemplateService.Create(pageTemplate.Id, "Foobar2", CmsPropertyType.RichTextEditor, null);
            var pageNode          = PageNodeService.CreateForSection(sectionNode.Id, pageTemplate.Id, "Foobar", "foobar");

            //act + assert
            pageNode.Properties.Count.Should().Be.EqualTo(2); //verify the page node was created with some properties

            PageNodeService.Delete(pageNode);

            //assert
            var propertiesForDeletedPageNode = UnitOfWork.Context.GetDbSet <PageProperty>().Where(x => x.ParentPageNodeId == pageNode.Id);

            propertiesForDeletedPageNode.Should().Be.Empty();
        }
 /// <summary>
 /// The initialize services.
 /// </summary>
 private void InitializeServices()
 {
     this.pageService = new PageService(this.pageRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageTemplateService = new PageTemplateService(this.pageTemplateRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageControllerActionService = new PageControllerActionService(this.pageControllerRepositoryActionMock.Object, new Mock<IUnitOfWork>().Object);
     this.partTypeService = new PartTypeService(this.partTypeRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.partService = new PartService(this.partRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.seoDecoratorService = new SeoDecoratorService(this.seoDecoratorRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.rolePageRestrictionService = new RolePageRestrictionService(this.rolePageRestrictionRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
 }
 private void InitializeServices()
 {
     this.domainService = new DomainService(this.domainRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.clientAssetConfigService = new ClientAssetConfigService(
         this.clientAssetConfigRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.clientAssetService = new ClientAssetService(
         this.clientAssetRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.clientAssetTypeService = new ClientAssetTypeService(
         this.clientAssetTypeRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageService = new PageService(this.pageRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageTemplateService = new PageTemplateService(
         this.pageTemplateRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageTemplateZoneMapService =
         new PageTemplateZoneMapService(
             this.pageTemplateZoneMapRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.pageZoneService = new PageZoneService(
         this.pageZoneRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.partService = new PartService(this.partRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.partTypeService = new PartTypeService(
         this.partTypeRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.seoDecoratorService = new SeoDecoratorService(
         this.seoDecoratorRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.userService = new UserService(this.userRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
     this.partContainerService = new PartContainerService(
         this.partContainerRepositoryMock.Object, new Mock<IUnitOfWork>().Object);
 }