public void Add_InvalidHtmlPassed_ReturnsBadRequest() { // Arrange var idMissingItem = new Banner() { Html = "<h1>test<h1>", Created = DateTime.Now }; _controller.ModelState.AddModelError("Html", "Invalid"); // Act var badResponse = _controller.Create(idMissingItem); // Assert Assert.IsType <BadRequestObjectResult>(badResponse.Result); }