Ejemplo n.º 1
0
        public async Task GetHackerNewsMaxItem()
        {
            try
            {
                var maxItem = await _service.GetHackerNewsMaxItem();

                Assert.IsTrue(maxItem > 0, "Max Item ID Retrieved");
            }
            catch (AssertFailedException ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> MaxItem([FromQuery] bool includeDetails)
        {
            if (includeDetails)
            {
                int maxItem = await _service.GetHackerNewsMaxItem();

                var item = await _service.GetHackerNewsItemDetails(maxItem);

                return(Ok(item));
            }
            else
            {
                int maxItem = await _service.GetHackerNewsMaxItem();

                return(Ok(maxItem));
            }
        }