public void CreateAirport_WhenDataIsIncorrect_CheckException() { AirportDTO.Name = null; var response = AirportController.CreateAirport(AirportDTO); Assert.IsNotNull(response); Assert.AreEqual(response.Result.GetType().Name, "ResponseMessageResult"); }
public void Create_WhenDataIsIncorrect_CheckModelStateInvalid() { AirportDTO.Name = null; AirportController.Validate(AirportDTO); var result = AirportController.CreateAirport(AirportDTO); Assert.AreEqual(result.Result.GetType().Name, "InvalidModelStateResult"); }
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); }