public ActionResult Index(UrlViewModel model)
        {
            model.ExpandedUri = urlService.Expand(model.ShortenedUri);

            if (model.ExpandedUri == null)
            {
                model.ErrorMessage = "Error: Please enter a valid URL.";
            }

            return(View(model));
        }
Esempio n. 2
0
        public void ShouldExpandShortenedUrl()
        {
            var uri = service.Expand("http://goo.gl/s4i0").AbsoluteUri;

            Assert.AreEqual("http://robertgreiner.com/", uri);
        }