public async Task Should_Return_400_Status_Code_With_Invalid_ViewModel() { // Arrange var data = new AbilityViewModel(); var abilitiesController = new AbilitiesController(abilityServices.Object); // Act var response = await abilitiesController.Create(data); // Assert Assert.NotNull(response); Assert.IsType <BadRequestObjectResult>(response.Result); }
public async Task Should_Return_201_Status_Code_With_Valid_ViewModel() { // var actionValue = Assert.IsAssignableFrom<IEnumerable<CustomerAddressViewModel>>(actionResult.Value); // Arrange var data = BogusViewModel.AbilityViewModelFaker(); abilityServices.Setup(x => x.CreateAbility(data)).ReturnsAsync(data); var abilitiesController = new AbilitiesController(abilityServices.Object); // Act var response = await abilitiesController.Create(data); // Assert Assert.NotNull(response); Assert.IsType <CreatedResult>(response.Result); }