Exemplo n.º 1
0
        public void Get_StarShip_Successfully()
        {
            var item = _swapiService.GetStarShipAsync().Result;

            Assert.NotNull(item);
            Assert.True(item.Success);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Main method that processes the request
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <KneatView> Process(GetStarShipRequest request)
        {
            dataResult = new KneatView();

            var response = await _swapiService.GetStarShipAsync();

            Calculate(response, request.Distance);

            while (!string.IsNullOrEmpty(response.Next))
            {
                response = await _swapiService.GetStarShipAsync(response.Next);

                Calculate(response, request.Distance);
            }

            return(dataResult);
        }