コード例 #1
0
        public async Task GetFourDomainsFromSampleFeed()
        {
            int expected = 4;

            await sut.AddTweet(model);

            var results = await sut.GetDomainList();

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

            Assert.Equal(expected, results.Count);
        }
コード例 #2
0
        public async Task <ActionResult <List <Entity> > > GetDomainListFromCollection()
        {
            List <Entity> list = new List <Entity>();

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

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