Пример #1
0
        public void BeerController_DeleteAction()
        {
            BeersController controller = new BeersController(new FakeRepositories.FakeBeerRepository());

            Beer beer = new Beer()
            {
                BeerId    = 1,
                Name      = "BeeBrew",
                Type      = "Ale",
                UnitPrice = 5,
                ABV       = 4
            };

            System.Web.Mvc.RedirectToRouteResult createBeer = controller.Create(beer) as System.Web.Mvc.RedirectToRouteResult;
            System.Web.Mvc.RedirectToRouteResult delete     = controller.DeleteConfirmed(1) as System.Web.Mvc.RedirectToRouteResult;
            System.Web.Mvc.RedirectToRouteResult result     = controller.Details(1) as System.Web.Mvc.RedirectToRouteResult;
            Assert.IsNull(result);
        }