Esempio n. 1
0
        public void EditItem()
        {
            var list = _service.Get();

            if (!IsEmpty(list))
            {
                // retriving guid of the item to edit
                Guid itemGuid = list[0].Id;

                UrlShortenerInput newItem = new UrlShortenerInput()
                {
                    URL       = "http://localhost/",
                    ShortLink = "My app"
                };

                var response = _service.Edit(itemGuid, newItem);

                Assert.AreNotEqual(list[0].URL, Input.URL);
                Assert.AreNotEqual(list[0].ShortLink, Input.ShortLink);
            }
        }
Esempio n. 2
0
        public IActionResult Put(Guid id, [FromBody] UrlShortenerInput input)
        {
            var response = _service.Edit(id, input);

            return(StatusCode(response.StatusCode, response.Message));
        }