Esempio n. 1
0
        public void FindItem()
        {
            var item = _service.GetBy("google");

            Assert.AreEqual(item.ShortLink, "Google");
            Assert.AreEqual(item.URL, "http://www.google.com");
        }
Esempio n. 2
0
        public IActionResult GetUrlBy(string shortLink)
        {
            var item = _service.GetBy(shortLink);

            if (item == null)
            {
                return(NotFound("Item not found"));
            }

            return(Ok(item.URL));
        }