public void ShouldRegisterArticleCategory()
        {
            RegisterArticleCategoryCommand command = new RegisterArticleCategoryCommand
            {
                Name = "Novos tópicos"
            };

            applicationService.Register(command);

            Assert.AreEqual(1, applicationService.GetAllCategories().Count());
        }
Exemplo n.º 2
0
        public void Register(RegisterArticleCategoryCommand command)
        {
            command.Validate();

            if (AddNotifications(command))
            {
                return;
            }

            ArticleCategory category = new ArticleCategory(command.Name);

            _repository.Register(category);

            Commit();
        }
Exemplo n.º 3
0
        //[Authorize(Policy = "AdminAccount")]
        public IActionResult Register([FromBody] RegisterArticleCategoryCommand command)
        {
            _categoryAppService.Register(command);

            return(CreateResponse());
        }