public void ShouldRegisterArticleCategory() { RegisterArticleCategoryCommand command = new RegisterArticleCategoryCommand { Name = "Novos tópicos" }; applicationService.Register(command); Assert.AreEqual(1, applicationService.GetAllCategories().Count()); }
public void Register(RegisterArticleCategoryCommand command) { command.Validate(); if (AddNotifications(command)) { return; } ArticleCategory category = new ArticleCategory(command.Name); _repository.Register(category); Commit(); }
//[Authorize(Policy = "AdminAccount")] public IActionResult Register([FromBody] RegisterArticleCategoryCommand command) { _categoryAppService.Register(command); return(CreateResponse()); }