public GetArticleDetailQueryHandler( IArticleRepo articleRepo, IMapper mapper) { _articleRepo = articleRepo; _mapper = mapper; }
public Handler( IArticleRepo articleRepo, IMediator mediator) { _articleRepo = articleRepo; _mediator = mediator; }
public MonitorSvc(IArticleRepo articleRepo, ICategoryRepo categoryRepo, ITagRepo tagRepo, ICommentRepo commentRepo) { _articleRepo = articleRepo; _categoryRepo = categoryRepo; _tagRepo = tagRepo; _commentRepo = commentRepo; }
public CategorySvc(ILogger <CategorySvc> logger, ICategoryRepo categoryRepo, IArticleRepo articleRepo, IArticleContentRepo articleContentRepo) { _logger = logger; _categoryRepo = categoryRepo; _articleRepo = articleRepo; _articleContentRepo = articleContentRepo; }
public ArticleService(IUserService uService, IArticleRepo repo, IRepo <ArticleComment> cRepo, IArticleLikeRepo alRepo, ICommentLikeRepo clRepo) { _uService = uService; _repo = repo; _cRepo = cRepo; _alRepo = alRepo; _clRepo = clRepo; }
/// <summary> /// Controller constructor /// </summary> /// <param name="logger"></param> /// <param name="articleRepo"></param> /// <param name="userRepo"></param> /// <param name="cartRepo"></param> /// <param name="transactionRepo"></param> public UserController(ILogger <UserController> logger, IArticleRepo articleRepo, IUserRepo userRepo, ICartRepo cartRepo, ITransactionRepo transactionRepo) { this._userRepo = userRepo; this._articleRepo = articleRepo; this._logger = logger; this._cartRepo = cartRepo; this._transactionRepo = transactionRepo; }
public ArticleApplication(IArticleRepo articleRepo) { _articleRepo = articleRepo; }
public ArticlesController(IArticleRepo repository) { Requires.NotNull(repository); this._repository = repository; }
public ArticleSvc(IArticleRepo articleRepo, IArticleTagRepo articleTagRepo) { _articleRepo = articleRepo; _articleTagRepo = articleTagRepo; }
public ArticlesController(IArticleRepo articleRepo, IMapper mapper) { _articleRepo = articleRepo; _mapper = mapper; }
public ArticleController(IArticleRepo repoAricle, IMapper mapper) { _repositoryArticle = repoAricle; _mapper = mapper; }
public ArticleService(IArticleRepo repo, IUnitOfWork uow, IEventBus eventBus) { this.repo = repo; this.uow = uow; this.eventBus = eventBus; }
public DAOFactory(ICategoryRepo categoryRepo, IArticleRepo articleRepo, ITagRepo tagRepo) { this.tagRepo = tagRepo; this.categoryRepo = categoryRepo; this.articleRepo = articleRepo; }
public ArticlesController(IArticleRepo repository, IMapper mapper, IMemoryCache memoryCache) { _repository = repository; _mapper = mapper; _memoryCache = memoryCache; }
public ArticleApplication(IArticleRepo articleRepo, IFileUploader fileUploader, IArticleCategoryRepo articleCategoryRepo) { _articleRepo = articleRepo; _fileUploader = fileUploader; _articleCategoryRepo = articleCategoryRepo; }
public ArticleController(IArticleRepo articleRepo, IArticleCommentRepo articleCommentRepo) { this._articleRepo = articleRepo; this._articleCommentRepo = articleCommentRepo; }
public ArticleServiceBiz(IArticleRepo Repository_Article_Val) { Repository_Article_P = Repository_Article_Val ?? new ArticleRepoBiz(); }
public ArticlesController(IArticleRepo repository, IMapper mapper) { _repository = repository; _mapper = mapper; }
/// <summary> /// Constructor for the user CRUD unit tests /// </summary> public ArticleRepoTests() { var articleMockRepo = new ArticleMockRepo(_articles); this._mockRepo = articleMockRepo._articleRepo; }
/// <summary> /// Public constructor for the mocked repository /// </summary> public ArticleMockRepo(List <Article> articles = null) { if (articles != null) { _articlesMockList = articles; } Mock <IArticleRepo> mockRepo = new Mock <IArticleRepo>(); // Mocks the function Get() mockRepo.Setup(articleRepo => articleRepo.Get("")).ReturnsAsync(DBOTODTOList(_articlesMockList)); // Mocks the function Insert() mockRepo.Setup(articleRepo => articleRepo.Insert(It.IsAny <DTOArticle>())).ReturnsAsync((DTOArticle articleModel) => { var max = Math.Max(_articlesMockList.Max(c => c.Id) + 1, _articlesMockList.Max(c => c.Id)); if (articleModel.Id > max) { return(null); } var article = DTOToDBO(articleModel); article.Id = max; if (articleModel.Name == null) { return(null); } this._articlesMockList.Add(article); return(DBOToDTO(article)); }); // Mocks the function Update() mockRepo.Setup(articleRepo => articleRepo.Update(It.IsAny <DTOArticle>())).ReturnsAsync((DTOArticle articleModel) => { var result = _articlesMockList.Where(c => c.Id == articleModel.Id); if (result.Count() != 1) { return(null); } var article = result.First(); if (article.SellerId != articleModel.SellerId) { return(null); } article.ImageSource = articleModel.ImageSource; article.Name = articleModel.Name; article.Price = articleModel.Price; article.Description = articleModel.Description; article.Category = articleModel.Category; article.Sex = articleModel.Sex; article.Brand = articleModel.Brand; article.Condition = articleModel.Condition; return(DBOToDTO(article)); }); // Mocks the function Delete() mockRepo.Setup(articleRepo => articleRepo.Delete(It.IsAny <long>())).ReturnsAsync((long i) => { var articles = _articlesMockList.Where(c => c.Id == i); if (articles.Count() == 1) { _articlesMockList.Remove(articles.First()); return(true); } return(false); }); // Mocks the function GetById() mockRepo.Setup(articleRepo => articleRepo.GetById(It.IsAny <long>())).Returns((long i) => { var count = _articlesMockList.Count(c => c.Id == i); if (count != 1) { return(null); } var article = _articlesMockList.Single(c => c.Id == i); return(DBOToDTOAsync(article)); }); // Mocks the function Count() mockRepo.Setup(articleRepo => articleRepo.Count()).ReturnsAsync(_articlesMockList.Count()); // Mocks the function GetUserFromId() mockRepo.Setup(articleRepo => articleRepo.GetUserFromId(It.IsAny <long>())).Returns((long i) => { if (_articlesMockList.Count(c => c.Id == i) == 0) { return(null); } var user = new DTOUser(); user.Id = 1; user.Email = "*****@*****.**"; user.Address = "3B Rue de La Poste 69110 FRANCHEVILLE"; user.Gender = "man"; user.Name = "Louis SANTOS"; user.Note = 10; user.UserName = "******"; return(user); }); this._articleRepo = mockRepo.Object; }
/// <summary> /// Public constructor for article controller /// </summary> /// <param name="articleRepo">Article repository for dependancy injection</param> /// <param name="userRepo">User repository for dependancy injection</param> /// <param name="logger">Logger for dependancy injection</param> public ArticleController(IArticleRepo articleRepo, IUserRepo userRepo, ILogger <ArticleController> logger) { _articleRepo = articleRepo; _userRepo = userRepo; _logger = logger; }