예제 #1
0
        public async Task <bool> PostRescheduledPayments(int ownerId, DateTime dueDate)
        {
            bool ret = false;
            ReschedulePaymentCommand command = new ReschedulePaymentCommand();

            try
            {
                ownerCollection = testDataManager.GetEnrolledOwnerCollection(ownerId);
                IReadOnlyList <Account> accounts = await GetBillingAccountByPolicyHolderId(ownerCollection.OwnerInformation.UniqueId.ToString());

                command.AccountId     = accounts.First().Id;
                command.RequestedDate = dueDate;
                RestRequestSpecification req = new RestRequestSpecification();
                req.Verb        = HttpMethod.Post;
                req.Headers     = Headers;
                req.ContentType = "application/json";
                req.RequestUri  = $"/v2/reschedulepayments";
                req.Content     = JsonSerializer.Serialize(command);
                var returnPost = await asyncRestClientBilling.ExecuteAsync <string>(req);

                ret = returnPost.Success;
            }
            catch (Exception ex)
            {
                log.Fatal(ex);
            }
            return(ret);
        }
        public async Task ReschedulePayments_empryCommand()
        {
            command         = new ReschedulePaymentCommand();
            request.Content = JsonSerializer.Serialize(command);
            rpResult        = await asyncRestClientBilling.ExecuteAsync <string>(request);

            Assert.IsFalse(rpResult.Success, $"successed");
            Assert.IsTrue(rpResult.Message.Contains(@"Unable to find local account by externalId"), $"unexpected message - {rpResult.Message}");
        }
        public void Init()
        {
            InitTestClass();

            request.Verb       = HttpMethod.Post;
            request.RequestUri = $"v2/reschedulepayments";

            command               = new ReschedulePaymentCommand();
            command.AccountId     = BillingApiTestSettings.Default.BillingServiceApiAccountExternalId.ToString();
            command.RequestedDate = DateTime.Now.AddDays(8);
        }