public void Search_Flight_InvalidObjectPassed_ReturnsBadRequest() { SearchInputDto searchInput = new SearchInputDto() { DepatureDateTime = Convert.ToDateTime(""), FromDestination = "Johannesburg", ToDestination = "Durban", NoOfPassenger = 50 }; _controller.ModelState.AddModelError("DepatureDateTime", "Required"); var badResponse = _controller.GetAvailableflight(searchInput); Assert.IsType <BadRequestObjectResult>(badResponse); }