public void Initialize()
 {
     _dataProviderMock.Setup(method => method.GetAuthorNewsItemRelations())
     .Returns(FizzWare.NBuilder.Builder <AuthorNewsItemRelation>
              .CreateListOfSize(5)
              .TheFirst(3).With(x => x.AuthorId = 1).With(x => x.NewsItemId = 1)
              .TheNext(2).With(x => x.AuthorId  = 2).With(x => x.NewsItemId = 1)
              .Build().ToList());
     _relationRepository = new AuthorNewsItemRelationRepository(_dataProviderMock.Object);
 }
Beispiel #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;
 }
Beispiel #3
0
 /// <summary>
 /// Initialize repository
 /// </summary>
 /// <param name="authorRepository">Which implementation of author repository to use</param>
 public AuthorService(IAuthorRepository authorRepository, IAuthorNewsItemRelationRepository newsItemRelationRepository, INewsItemService newsItemService)
 {
     _authorRepository           = authorRepository;
     _newsItemRelationRepository = newsItemRelationRepository;
     _newsItemService            = newsItemService;
 }