Exemplo n.º 1
0
        public async Task GetOneUrlFromSampleFeed()
        {
            int expected = 1;

            await sut.AddTweet(model);

            var results = await sut.GetUrlList();

            Assert.IsType <List <Url> >(results);

            Assert.Equal(expected, results.Count);
        }
Exemplo n.º 2
0
        public async Task <ActionResult <List <Url> > > GetUrlListFromCollection()
        {
            List <Url> list = new List <Url>();

            try
            {
                var result = await cache.GetUrlList();

                if (result == null)
                {
                    return(NotFound("Null Data"));
                }
                else
                {
                    return(Ok(result.ToList()));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }