public async Task AddRange_ValidCompanies_ReturnsOkOkResult() { var nameMissingItem = new Company() { Description = "Description 1" }; var createdResponse = await ControllerUnderTest.AddRange(new[] { nameMissingItem }); Assert.IsType <OkResult>(createdResponse); }
public async Task AddRange_CompanyWithoutName_ReturnsBadRequest() { var nameMissingItem = new Company() { Description = "Description 1" }; ControllerUnderTest.ModelState.AddModelError("Name", "Required"); var badResponse = await ControllerUnderTest.AddRange(new[] { nameMissingItem }); Assert.IsType <BadRequestObjectResult>(badResponse); }