Exemplo n.º 1
0
        public async Task EnablePaymentMethodAsync_WhenEnablingPaymentMethodForProfile_PaymentMethodIsReturned()
        {
            // Given: We retrieve the profile from the API
            ProfileClient profileClient = new ProfileClient("abcde"); // Set access token
            ListResponse <ProfileResponse> allProfiles = await profileClient.GetProfileListAsync();

            if (allProfiles.Items.Count == 0)
            {
                Assert.Inconclusive("No profiles found. Unable to continue test");
            }
            ProfileResponse profileToTestWith = allProfiles.Items.First();


            // When: We enable a payment method for the given profile
            PaymentMethodResponse paymentMethodResponse = await profileClient.EnablePaymentMethodAsync(profileToTestWith.Id, PaymentMethod.Ideal);

            // Then: Make sure a payment method is returned
            Assert.IsNotNull(paymentMethodResponse);
            Assert.AreEqual(PaymentMethod.Ideal, paymentMethodResponse.Id);
        }