public void Index_ValidUrlSubmitted()
        {
            HomeController controller = new HomeController();

            ViewResult result = controller.Index(string.Empty, "http://www.test.com") as ViewResult;

            Assert.AreEqual("UrlAdded", result.ViewName);
        }
        public void Index_ValidShortUrl()
        {
            HomeController controller = new HomeController();

            RedirectResult result = controller.Index("N", string.Empty) as RedirectResult;

            Assert.AreEqual("https://news.ycombinator.com/news", result.Url);
        }
        public void Index_InvalidUrl_LocalPath()
        {
            HomeController controller = new HomeController();

            ViewResult result = controller.Index(string.Empty, "c:\test") as ViewResult;

            Assert.AreEqual("Invalid URL! Please submit a different one.", result.ViewBag.ErrorInvalidUrl);
        }
        public void Index_NoParameters()
        {
            HomeController controller = new HomeController();

            ViewResult result = controller.Index(string.Empty, string.Empty) as ViewResult;

            Assert.AreEqual(null, result.ViewBag.ErrorInvalidUrl);
        }
        public void Index_InvalidShortUrl()
        {
            HomeController controller = new HomeController();

            ViewResult result = controller.Index("BYCCX", string.Empty) as ViewResult;

            Assert.AreEqual("Shortened URL not found. Please shorten another!", result.ViewBag.ErrorInvalidShortCode);
        }