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)); }
public void ShouldExpandShortenedUrl() { var uri = service.Expand("http://goo.gl/s4i0").AbsoluteUri; Assert.AreEqual("http://robertgreiner.com/", uri); }