コード例 #1
0
        public void Create_ReturnsCorrectActionType_RedirectToActionResult()
        {
            WordsController controller = new WordsController();
            IActionResult   view       = controller.Create("Walk the dog");

            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
コード例 #2
0
        public void Create_RedirectsToCorrectAction_Index()
        {
            WordsController        controller   = new WordsController();
            RedirectToActionResult actionResult = controller.Create("walk the dog") as RedirectToActionResult;
            string result = actionResult.ActionName;

            Assert.AreEqual(result, "Index");
        }
コード例 #3
0
        public void Create_RedirectsToCorrectAction_Index()
        {
            //Arrange
            WordsController        controller   = new WordsController();
            RedirectToActionResult actionResult = controller.Create("cat", "the cat in the hat") as RedirectToActionResult;

            //Act
            string result = actionResult.ActionName;

            //Assert
            Assert.AreEqual(result, "Index");
        }
コード例 #4
0
        public void Create_ReturnsCorrectActionType_RedirectToActionResult()
        {
            //Arrange
            // Words myWords = new Words("cat", "the cat in the hat");
            WordsController controller = new WordsController();

            //Act
            IActionResult view = controller.Create("cat", "the cat in the hat");

            //Assert
            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }