public void ShouldRegisterTicketCategory() { RegisterTicketCategoryCommand command = new RegisterTicketCategoryCommand() { Name = "Problemas de na criação de ordens" }; appService.Register(command); Assert.AreEqual(1, appService.GetAllCategories().Count()); }
public void Register(RegisterTicketCategoryCommand command) { command.Validate(); if (AddNotifications(command)) { return; } TicketCategory ticketCategory = new TicketCategory(command.Name); _repository.Register(ticketCategory); Commit(); }
//[Authorize(Roles = "SupportAccount,AdminAccount")] public IActionResult Register([FromBody] RegisterTicketCategoryCommand command) { _ticketCategoryApplicationService.Register(command); return(CreateResponse()); }