public async Task APIGateway_GetClientPayments_IsSuccess()
        {
            var getPayments = await _productionApiGateway.GetClientPayments();

            Assert.IsTrue(getPayments.IsSuccess,
                          "Could not get client payments.");
        }
示例#2
0
        /// <summary>
        /// Obtem os pagamentos realizados, da API.
        /// </summary>
        private async Task <Result <List <ApiResponse> > > GetPayments()
        {
            var paymentsRequest = await _gateway.GetClientPayments();

            if (!paymentsRequest.IsSuccess)
            {
                return(Result <List <ApiResponse> >
                       .Fail(null, $"Error on GetPayments Request: " +
                             string.Join(", ", paymentsRequest.Errors)));
            }

            return(Result <List <ApiResponse> > .Ok(
                       JsonConvert.DeserializeObject <List <ApiResponse> >(paymentsRequest.Value)));
        }