DDEX.ValidatorService.Controllers.HomeController.Index C# (CSharp) Method

Index() private method

private Index ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to the DDEX validator!";

            return View();
        }

Usage Example

Ejemplo n.º 1
0
        public void Index()
        {
            // Arrange
            var validator = new Mock<IDdexValidator>();
            var controller = new HomeController(validator.Object);

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

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual("Welcome to the DDEX validator!", result.ViewBag.Message);
        }