public async void Update_ShowsCorrectView() { Repository.Setup(r => r.GetByIdAsync(1)).ReturnsAsync(SportGenerator.Create()); var result = await Controller.Edit(1); Assert.IsType <ViewResult>(result); var viewResult = result as ViewResult; Assert.Null(viewResult.ViewName); }
public void EditNoId() { // arrange int?id = null; // act ViewResult result = (ViewResult)controller.Edit(id); // assert Assert.AreEqual("Error", result.ViewName); }