public void Should_Insert_Professional_With_Success() { //Arrange var professionalDto = new ProfessionalDto { ProfessionalId = 2, Code = Guid.Parse("1b92f96f-6a71-4655-a0b9-93c5f6ad9637"), Address = new Address("Rua teste", "98765", "APT 9876", new ZipCode("23156478")), Email = "*****@*****.**", Name = "Jose da Silva", Phone = "58962348", Specialties = new List <SpecialtyDto> { new SpecialtyDto { Id = 1, Description = "Anestesiologia" } } }; //Act var result = _professionalAppService.CreateProfessional(professionalDto); //Assert Assert.False(LocalNotification.HasNotification()); result.ProfessionalId.ShouldBe(2); }
public IActionResult Post([FromBody] ProfessionalDto professional) { var response = _professionalAppService.CreateProfessional(professional); return(CreateResponse <ProfessionalDto, ComposeKey <Guid, decimal> >() .FromErrorEnum(ProfessionalDto.Error.PostProfessional) .WithMessage(AppConsts.LocalizationSourceName, ProfessionalDto.Error.PostProfessional) .WithDto(response) .Build()); }