public async Task TeamProfilesController_Edit_Test3() { // Initialization TeamProfilesController ctl = new TeamProfilesController(); // To test if it is null var result = await ctl.Edit(1); Assert.IsNotNull(result); // To test if it is a valid id var model = (ProfileIndexViewModel)((ViewResult)result).Model; Assert.IsNotNull(model); }
public async Task TeamProfilesController_Edit_Test4() { // Initialization TeamProfilesController ctl = new TeamProfilesController(); // To test if it is null var result = await ctl.Edit(1); var model = (ProfileIndexViewModel)((ViewResult)result).Model; model.teamProfile.name = "Anne"; var result2 = ctl.Edit(model); Assert.IsNotNull(result); }
public async Task TeamProfilesController_Edit_Test2() { // Initialization TeamProfilesController ctl = new TeamProfilesController(); // To test if it is null var result = await ctl.Edit(21); Assert.IsNotNull(result); // To test if it is a valid id Assert.IsInstanceOfType(result, typeof(HttpNotFoundResult)); var model = (HttpNotFoundResult)result; Assert.AreEqual(404, model.StatusCode); }