Exemplo n.º 1
0
        public void NotEmptyView_RedirectsToNotFoundIfModelIsNull()
        {
            controller.When(sub => sub.RedirectToNotFound()).DoNotCallBase();
            controller.RedirectToNotFound().Returns(new RedirectToRouteResult(new RouteValueDictionary()));

            ActionResult expected = controller.RedirectToNotFound();
            ActionResult actual   = controller.NotEmptyView(null);

            Assert.AreSame(expected, actual);
        }
        public void RedirectToNotFound_Route()
        {
            RouteValueDictionary actual = controller.RedirectToNotFound().RouteValues;

            Assert.Equal("NotFound", actual["action"]);
            Assert.Equal("Home", actual["controller"]);
            Assert.Equal("", actual["area"]);
            Assert.Equal(3, actual.Count);
        }