コード例 #1
0
		private void CreateWizardSteps(DynamicContentPublishingGroup item)
		{
			var itemParameter = new KeyValuePair<string,object>("item", item);

            RegisterStep(_overviewVmFactory.GetViewModelInstance(itemParameter));
            RegisterStep(_placesVmFactory.GetViewModelInstance(itemParameter));
            RegisterStep(_contentVmFactory.GetViewModelInstance(itemParameter));
            RegisterStep(_conditionsVmFactory.GetViewModelInstance(itemParameter));
		}
コード例 #2
0
		public CreateContentPublishingItemViewModel(
			IViewModelsFactory<IContentPublishingOverviewStepViewModel> overviewVmFactory,
 			IViewModelsFactory<IContentPublishingContentPlacesStepViewModel> placesVmFactory,
			IViewModelsFactory<IContentPublishingDynamicContentStepViewModel> contentVmFactory,
			IViewModelsFactory<IContentPublishingConditionsStepViewModel> conditionsVmFactory,
			DynamicContentPublishingGroup item)
		{
		    _overviewVmFactory = overviewVmFactory;
			_placesVmFactory = placesVmFactory;
			_conditionsVmFactory = conditionsVmFactory;
			_contentVmFactory = contentVmFactory;

			CreateWizardSteps(item);
		}
コード例 #3
0
        public static TestContentPublishingBuilder BuildDynamicContentPublishingGroup()
        {
            var contentPublishing = new DynamicContentPublishingGroup()
            {
                Name = "default",
                Description = "default_Description",
                Priority = 5,
                IsActive = true,
                StartDate = DateTime.Now.Date.AddDays(-5),
                EndDate = DateTime.Now.Date.AddDays(5)

            };

            return new TestContentPublishingBuilder(contentPublishing);
        }
コード例 #4
0
 private TestContentPublishingBuilder(DynamicContentPublishingGroup contentPublishingGroup)
 {
     _contentPublishingGroup = contentPublishingGroup;
 }
コード例 #5
0
		public ContentPublishingOverviewStepViewModel(IRepositoryFactory<IDynamicContentRepository> repositoryFactory,
			IDynamicContentEntityFactory entityFactory, DynamicContentPublishingGroup item)
			: base(null, null, repositoryFactory, null, entityFactory, item)
		{

		}
コード例 #6
0
		public ContentPublishingConditionsStepViewModel(
			IRepositoryFactory<ICountryRepository> countryRepositoryFactory,
			IViewModelsFactory<ISearchCategoryViewModel> searchCategoryVmFactory,
			IRepositoryFactory<IStoreRepository> storeRepositoryFactory,
			IRepositoryFactory<IDynamicContentRepository> repositoryFactory,
			IDynamicContentEntityFactory entityFactory, 
			DynamicContentPublishingGroup item)
			: base(countryRepositoryFactory, searchCategoryVmFactory, repositoryFactory, storeRepositoryFactory, entityFactory, item)
		{

		}
コード例 #7
0
		public void Can_save_content_publishing_with_5_conditions_in_ExpressionBuilder()
		{
			var client = GetRepository();

			var groupId = Guid.NewGuid().ToString();
			var dbReviewreview = new DynamicContentPublishingGroup
				{
				DynamicContentPublishingGroupId = groupId,
				Name = "Test content publishing", 
				Description = "Test content publishing description", 
				IsActive = true, 
				Priority = 1,
			};

			client.Add(dbReviewreview);
			client.UnitOfWork.Commit();

			//RefreshClient
			RefreshRepository(ref client);

			var loadedContentPublishing = client.PublishingGroups.Where(r => r.DynamicContentPublishingGroupId == groupId).SingleOrDefault();
			Assert.Equal(groupId, loadedContentPublishing.DynamicContentPublishingGroupId);

			//aa: add conditions expression and predicate tree serialized of 5 conditions.
			loadedContentPublishing.ConditionExpression = ConditionExpression;
			loadedContentPublishing.PredicateVisualTreeSerialized = PredicateSerialized;
			
			client.UnitOfWork.Commit();

			//RefreshClient
			RefreshRepository(ref client);
			loadedContentPublishing = client.PublishingGroups.Where(r => r.DynamicContentPublishingGroupId == groupId).SingleOrDefault();
		}