public void Index()
        {
            // Arrange
            PingController controller = new PingController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual("Home Page", result.ViewBag.Title);
        }
Example #2
0
        public void Index()
        {
            var pingCtrl = new PingController();

            var result = pingCtrl.Index();

            //assert
            Assert.IsInstanceOf <JsonResult>(result);
            var data = ((JsonResult)result).Data;
            var type = data.GetType();
            var alivePropertyInfo = type.GetProperty("alive");
            var actual            = alivePropertyInfo.GetValue(data, null);

            Assert.AreEqual(true, actual);
        }
Example #3
0
        public void ThisController()
        {
            var controller = new PingController();

            _result = controller.Index();
        }