public void UpdateFlight_WhenDataIsCorrect_CheckResult() { TestEnvironmentManager.DeleteFlightTest(FlightService, FlightDTO.Name); if (FlightController.CreateFlight(FlightDTO).Result.GetType().Name.Equals("OkNegotiatedContentResult`1")) { FlightDTO = DistributedServicesAutoMapper.Map <FlightDTO>(FlightService.GetFlight(new Domain.BO.Flights.FlightDTO { Name = FlightDTO.Name })); FlightDTO.Name += "_Updated"; FlightDTO.DepartureAirport.AirportId = 17; FlightDTO.DepartureAirport.Name = "Málaga (AGP)"; FlightDTO.DestinationAirport.AirportId = 18; FlightDTO.DestinationAirport.Name = "Sevilla (SEV)"; var response = FlightController.UpdateFlight(FlightDTO); Assert.IsNotNull(response); TestEnvironmentManager.DeleteFlightTest(FlightService, FlightDTO.Name); } else { Assert.Fail(); } }
public void CreateAirport_WhenDataIsCorrect_CheckCreateOneAirport() { TestEnvironmentManager.DeleteAirportTest(AirportService, AirportDTO.Name); var response = AirportController.CreateAirport(AirportDTO); Assert.IsNotNull(response); Assert.AreEqual(response.Result.GetType().Name, "OkNegotiatedContentResult`1"); TestEnvironmentManager.DeleteAirportTest(AirportService, AirportDTO.Name); }