public void Add_ReturnsBadRequest() { // Arrange var nameMissingItem = new InventoryItem() { Manufacturer = "Man", Price = 100 }; _controller.ModelState.AddModelError("Name", "Required"); // Act var badResponse = _controller.Post(nameMissingItem).Result; // Assert Assert.IsType <BadRequestResult>(badResponse); }