public void EditNoIdLoadsError() { // arrange int?id = null; // act ViewResult result = (ViewResult)controller.Edit(id); // assert Assert.AreEqual("Error", result.ViewName); }
public async Task EditShouldReturnNotFoundIfBikeDoesNotExist() { //Arrange var userManager = UserManagerMock.New; var controller = new BikesController(null, userManager.Object); //userManager.Setup() //Act var result = await controller.Edit(1); //Assert result .Should() .BeOfType <NotFoundResult>(); }