public static HotelReservationUpdateCommandBuilder Start() { _command = new HotelReservationUpdateCommand() { }; return(new HotelReservationUpdateCommandBuilder()); }
public async Task <IActionResult> Update(HotelReservationUpdateCommand flightUpdateCmd) { var result = await _mediator.Send(flightUpdateCmd); if (result) { return(Ok()); } else { return(BadRequest()); } }
public void UpdateHotelReservation_IntegrationTest() { var hotelReservationCmd = new HotelReservationUpdateCommand() { Id = 1, OutputDate = DateTime.Now.AddDays(20).Date, Description = "Teste atualização" }; var myContent = JsonConvert.SerializeObject(hotelReservationCmd); var stringContent = new StringContent(myContent, UnicodeEncoding.UTF8, "application/json"); var httpResponse = _client.PutAsync($"{_url}", stringContent).Result; httpResponse.EnsureSuccessStatusCode(); var carReservationUpdated = CustomWebApplicationFactory <Startup> .appDb.HotelReservation.Find(1); //carReservationUpdated.OutputDate.Date.Should().Be(DateTime.Now.AddDays(20).Date); //carReservationUpdated.Description.Should().Be("Teste atualização"); }