public async Task <IActionResult> CreateAddress([FromRoute] int userId, [FromBody] CreateUserAddressCommand createAddressCommand) { createAddressCommand.UserId = userId; var response = await _mediator.Send(createAddressCommand); return(StatusCode(response.StatusCode, response.GetResponse)); }
public CreateUserAddressCommandHandlerTests() { _mediator = Substitute.For <IMediator>(); _addressRepository = Substitute.For <IAddressRepository>(); var logger = Substitute.For <ILogger <CreateUserAddressCommandHandler> >(); _handler = new CreateUserAddressCommandHandler(logger, _mediator, _addressRepository); _command = new CreateUserAddressCommand { Name = "Casa", UserId = 10, StreetName = "Rua Komakite Ikeda", StreetNumber = 1592, Cep = "18303260", City = "Capão Bonito", State = "SP" }; }