public void GivenAnInValidSetOfParameters_WhenICreateATodoItem_ThenTheNewViewIsShown() { var controller = new TodoController(); controller.ModelState.AddModelError("foo", "bar"); ViewResult result = controller.Create(new NewTodoModel()) as ViewResult; Assert.That(result.ViewName, Is.EqualTo("New").IgnoreCase); }
public void GivenAValidSetOfParameters_WhenICreateATodoItem_ThenTheListOfItemsIsShown() { var controller = new TodoController(); var result = controller.Create(new NewTodoModel()); Assert.That(result, Is.TypeOf<RedirectToRouteResult>()); }