コード例 #1
0
        public void Destroy_ReturnsCorrectActionType_RedirectToActionResult()
        {
            StylistsController controller = new StylistsController();
            IActionResult      view       = controller.Destroy(1);

            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
コード例 #2
0
        public void Destroy_ReturnsCorrectView_True()
        {
            StylistsController controller = new StylistsController();
            ActionResult       showView   = controller.Destroy(1, 1);

            Assert.IsInstanceOfType(showView, typeof(ViewResult));
        }
コード例 #3
0
        public void Destroy_HasCorrectModelType_Dictionary()
        {
            StylistsController controller = new StylistsController();
            ViewResult         newView    = controller.Destroy(1, 1) as ViewResult;
            var result = newView.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>));
        }
コード例 #4
0
        public void Destroy_RedirectsToCorrectAction_Index()
        {
            StylistsController     controller   = new StylistsController();
            RedirectToActionResult actionResult = controller.Destroy(1) as RedirectToActionResult;
            string result = actionResult.ActionName;

            Assert.AreEqual(result, "Index");
        }