示例#1
0
        public void Create_ReturnsCorrectActionType_RedirectToActionResult()
        {
            //Arrange
            PackerTrackerController controller = new PackerTrackerController();

            //Act
            IActionResult view = controller.Create("tent");

            //Assert
            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
示例#2
0
        public void Create_RedirectsToCorrectAction_Index()
        {
            //Arrange
            PackerTrackerController controller   = new PackerTrackerController();
            RedirectToActionResult  actionResult = controller.Create("tent") as RedirectToActionResult;

            //Act
            string result = actionResult.ActionName;

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