public void Create_ReturnsCorrectView_True() { StylistsController controller = new StylistsController(); ActionResult Create = controller.Create("Mary Jane"); Assert.IsInstanceOfType(Create, typeof(RedirectToActionResult)); }
public void Create_ReturnsCorrectView_True() { StylistsController controller = new StylistsController(); ActionResult createView = controller.Create(1, "bob", "foo", "409-582-3251", "bobfooATgmailDOTcom"); Assert.IsInstanceOfType(createView, typeof(ViewResult)); }
public void Create_ReturnsCorrectActionType_RedirectToActionResult() { StylistsController controller = new StylistsController(); IActionResult view = controller.Create("bob", "foo", "409-582-3251", "bobfooATgmailDOTcom"); Assert.IsInstanceOfType(view, typeof(RedirectToActionResult)); }
public void Create_ReturnsCorrectActionType_RedirectToActionResult() { StylistsController controller = new StylistsController(); IActionResult view = controller.Create("Billy Bob"); Assert.IsInstanceOfType(view, typeof(RedirectToActionResult)); }
public void Create_ReturnsCorrectView_True() { StylistsController controller = new StylistsController(); ActionResult indexView = controller.Create(); Assert.IsInstanceOfType(indexView, typeof(ViewResult)); }
public void Create_RedirectsToCorrectAction_Index() { StylistsController controller = new StylistsController(); RedirectToActionResult actionResult = controller.Create("bob", "foo", "409-582-3251", "bobfooATgmailDOTcom") as RedirectToActionResult; string result = actionResult.ActionName; Assert.AreEqual(result, "Index"); }
public void Create_HasCorrectModelType_Dictionary() { StylistsController controller = new StylistsController(); ViewResult createView = controller.Create(1, "bob", "foo", "409-582-3251", "bobfooATgmailDOTcom") as ViewResult; var result = createView.ViewData.Model; Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>)); }
public void Create_RedirectsToCorrectAction_Index() { StylistsController controller = new StylistsController(); RedirectToActionResult actionResult = controller.Create("stylist face") as RedirectToActionResult; string result = actionResult.ActionName; Assert.AreEqual(result, "Index"); }
public void Create_ReturnsCorrectActionType_StylistList() { string firstName = "Sylvia"; string lastName = "Green"; string phoneNumber = "206-555-6789"; int id = 1; Stylist stylist = new Stylist(firstName, lastName, phoneNumber, id); StylistsController controller = new StylistsController(); IActionResult view = controller.Create(firstName, lastName, phoneNumber, id); Assert.IsInstanceOfType(view, typeof(RedirectToActionResult)); }
public void Create_ReturnsCorrectActionType_ViewResult() { //Arrange StylistsController controller = new StylistsController(); //Act DateTime hireDate = new DateTime(2019, 1, 1); IActionResult view = controller.Create("Jane Doe", hireDate); //Assert Assert.IsInstanceOfType(view, typeof(ViewResult)); }
public void Create_RedirectsToCorrectAction_Index() { string firstName = "Sylvia"; string lastName = "Green"; string phoneNumber = "206-555-6789"; Stylist stylist = new Stylist(firstName, lastName, phoneNumber); int id = stylist.GetId(); StylistsController controller = new StylistsController(); RedirectToActionResult actionResult = controller.Create(firstName, lastName, phoneNumber, id) as RedirectToActionResult; string result = actionResult.ActionName; Assert.AreEqual(result, "Index"); }