public void Initialize()
 {
     _dataProviderMock.Setup(method => method.GetNewsItemCategoryRelations())
     .Returns(FizzWare.NBuilder.Builder <NewsItemCategoryRelation>
              .CreateListOfSize(5)
              .TheFirst(3).With(x => x.NewsItemId = 1).With(x => x.CategoryId = 1)
              .TheNext(2).With(x => x.NewsItemId  = 2).With(x => x.CategoryId = 1)
              .Build().ToList());
     _relationRepository = new NewsItemCategoryRelationRepository(_dataProviderMock.Object);
 }
Example #2
0
 /// <summary>
 /// Initialize respository
 /// </summary>
 /// <param name="newsItemRepository">Which implementation of news item repository to use</param>
 public NewsItemService(INewsItemRepository newsItemRepository, INewsItemCategoryRelationRepository categoryRelationRepository, IAuthorNewsItemRelationRepository authorRelationRepository)
 {
     _newsItemRepository         = newsItemRepository;
     _categoryRelationRepository = categoryRelationRepository;
     _authorRelationRepository   = authorRelationRepository;
 }
Example #3
0
 /// <summary>
 /// Initialize repository
 /// </summary>
 /// <param name="categoryRepository">Which implementation of category repository to use</param>
 public CategoryService(ICategoryRepository categoryRepository, INewsItemCategoryRelationRepository newsItemRelationRepository, INewsItemService newsItemService)
 {
     _categoryRepository         = categoryRepository;
     _newsItemRelationRepository = newsItemRelationRepository;
     _newsItemService            = newsItemService;
 }