From 376231338f471f3dc3867a405676a1b54ad97d14 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Wed, 29 May 2019 20:36:50 -0700 Subject: [PATCH] Use StripeClient instance in tests (#1634) --- src/StripeTests/BaseStripeTest.cs | 10 ++++++---- src/StripeTests/Functional/NetworkRetriesTest.cs | 2 ++ .../Infrastructure/Public/StripeResponseTest.cs | 8 ++++---- .../Infrastructure/Public/SystemNetHttpClientTest.cs | 10 +++++++++- src/StripeTests/Infrastructure/StripeExceptionTest.cs | 5 ++++- .../Services/AccountLinks/AccountLinkServiceTest.cs | 2 +- .../Services/Accounts/AccountServiceTest.cs | 2 +- .../ApplePayDomains/ApplePayDomainServiceTest.cs | 2 +- .../ApplicationFeeRefundServiceTest.cs | 2 +- .../ApplicationFees/ApplicationFeeServiceTest.cs | 2 +- src/StripeTests/Services/AutoPagingTest.cs | 2 +- src/StripeTests/Services/Balance/BalanceServiceTest.cs | 2 +- .../BalanceTransactionServiceTest.cs | 2 +- .../Services/BankAccounts/BankAccountServiceTest.cs | 2 +- .../Services/Capabilities/CapabilityServiceTest.cs | 2 +- src/StripeTests/Services/Cards/CardServiceTest.cs | 2 +- src/StripeTests/Services/Charges/ChargeServiceTest.cs | 2 +- .../Services/Checkout/SessionServiceTest.cs | 2 +- .../Services/CountrySpecs/CountrySpecServiceTest.cs | 2 +- src/StripeTests/Services/Coupons/CouponServiceTest.cs | 2 +- .../Services/CreditNotes/CreditNoteServiceTest.cs | 2 +- .../Services/Customers/CustomerServiceTest.cs | 2 +- .../Services/Discounts/DiscountServiceTest.cs | 2 +- .../Services/Disputes/DisputeServiceTest.cs | 2 +- .../Services/EphemeralKeys/EphemeralKeyServiceTest.cs | 2 +- src/StripeTests/Services/Events/EventServiceTest.cs | 2 +- .../Services/ExchangeRates/ExchangeRateServiceTest.cs | 2 +- .../ExternalAccounts/ExternalAccountServiceTest.cs | 2 +- .../Services/FileLinks/FileLinkServiceTest.cs | 2 +- src/StripeTests/Services/Files/FileServiceTest.cs | 2 +- .../Services/InvoiceItems/InvoiceItemServiceTest.cs | 2 +- .../Services/Invoices/InvoiceServiceTest.cs | 2 +- .../Issuing/Authorizations/AuthorizationServiceTest.cs | 2 +- .../Issuing/Cardholders/CardholderServiceTest.cs | 2 +- .../Services/Issuing/Cards/IssuingCardServiceTest.cs | 2 +- .../Issuing/Disputes/IssuingDisputeServiceTest.cs | 2 +- .../Issuing/Transactions/TransactionServiceTest.cs | 2 +- .../Services/LoginLinks/LoginLinkServiceTest.cs | 2 +- .../Services/OAuth/OAuthTokenServiceTest.cs | 4 ++-- src/StripeTests/Services/Orders/OrderServiceTest.cs | 2 +- .../PaymentIntents/PaymentIntentServiceTest.cs | 2 +- .../PaymentMethods/PaymentMethodServiceTest.cs | 2 +- src/StripeTests/Services/Payouts/PayoutServiceTest.cs | 2 +- src/StripeTests/Services/Persons/PersonServiceTest.cs | 2 +- src/StripeTests/Services/Plans/PlanServiceTest.cs | 2 +- .../Services/Products/ProductServiceTest.cs | 2 +- .../EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs | 2 +- .../Radar/ValueListItems/ValueListItemServiceTest.cs | 2 +- .../Services/Radar/ValueLists/ValueListServiceTest.cs | 2 +- src/StripeTests/Services/Refunds/RefundServiceTest.cs | 2 +- .../Reporting/ReportRuns/ReportRunServiceTest.cs | 2 +- .../Reporting/ReportTypes/ReportTypeServiceTest.cs | 2 +- src/StripeTests/Services/Reviews/ReviewServiceTest.cs | 2 +- .../ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs | 2 +- src/StripeTests/Services/Skus/SkuServiceTest.cs | 2 +- .../SourceTransactions/SourceTransactionServiceTest.cs | 2 +- src/StripeTests/Services/Sources/SourceServiceTest.cs | 2 +- .../SubscriptionItems/SubscriptionItemServiceTest.cs | 2 +- .../SubscriptionScheduleRevisionServiceTest.cs | 2 +- .../SubscriptionScheduleServiceTest.cs | 2 +- .../Services/Subscriptions/SubscriptionServiceTest.cs | 2 +- src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs | 2 +- .../Services/TaxRates/TaxRateServiceTest.cs | 2 +- .../ConnectionTokens/ConnectionTokenServiceTest.cs | 2 +- .../Services/Terminal/Locations/LocationServiceTest.cs | 2 +- .../Services/Terminal/Readers/ReaderServiceTest.cs | 2 +- .../Services/ThreeDSecure/ThreeDSecureServiceTest.cs | 2 +- src/StripeTests/Services/Tokens/TokenServiceTest.cs | 2 +- src/StripeTests/Services/Topups/TopupServiceTest.cs | 2 +- .../TransferReversals/TransferReversalServiceTest.cs | 2 +- .../Services/Transfers/TransferServiceTest.cs | 2 +- .../UsageRecordSummaryServiceTest.cs | 2 +- .../Services/UsageRecords/UsageRecordServiceTest.cs | 2 +- .../WebhookEndpoints/WebhookEndpointServiceTest.cs | 2 +- 74 files changed, 95 insertions(+), 80 deletions(-) diff --git a/src/StripeTests/BaseStripeTest.cs b/src/StripeTests/BaseStripeTest.cs index e8463d1b16..9e15a06f4c 100644 --- a/src/StripeTests/BaseStripeTest.cs +++ b/src/StripeTests/BaseStripeTest.cs @@ -59,7 +59,7 @@ public BaseStripeTest( // Set up StripeClient to use stripe-mock with the mock HTTP client var httpClient = new SystemNetHttpClient( new HttpClient(this.MockHttpClientFixture.MockHandler.Object)); - StripeConfiguration.StripeClient = this.StripeMockFixture.BuildStripeClient( + this.StripeClient = this.StripeMockFixture.BuildStripeClient( httpClient: httpClient); // Reset the mock before each test @@ -68,14 +68,14 @@ public BaseStripeTest( else if (this.StripeMockFixture != null) { // Set up StripeClient to use stripe-mock - StripeConfiguration.StripeClient = this.StripeMockFixture.BuildStripeClient(); + this.StripeClient = this.StripeMockFixture.BuildStripeClient(); } else if (this.MockHttpClientFixture != null) { // Set up StripeClient with the mock HTTP client var httpClient = new SystemNetHttpClient( new HttpClient(this.MockHttpClientFixture.MockHandler.Object)); - StripeConfiguration.StripeClient = new StripeClient( + this.StripeClient = new StripeClient( "sk_test_123", httpClient: httpClient); @@ -85,10 +85,12 @@ public BaseStripeTest( else { // Use the default StripeClient - StripeConfiguration.StripeClient = null; + this.StripeClient = new StripeClient("sk_test_123"); } } + protected IStripeClient StripeClient { get; } + protected MockHttpClientFixture MockHttpClientFixture { get; } protected StripeMockFixture StripeMockFixture { get; } diff --git a/src/StripeTests/Functional/NetworkRetriesTest.cs b/src/StripeTests/Functional/NetworkRetriesTest.cs index d0df0b3ed2..5af05901ee 100644 --- a/src/StripeTests/Functional/NetworkRetriesTest.cs +++ b/src/StripeTests/Functional/NetworkRetriesTest.cs @@ -17,12 +17,14 @@ public NetworkRetriesTest(MockHttpClientFixture mockHttpClientFixture) { StripeConfiguration.MaxNetworkRetries = 2; StripeConfiguration.NetworkRetriesSleep = false; + StripeConfiguration.StripeClient = this.StripeClient; } public void Dispose() { StripeConfiguration.MaxNetworkRetries = 0; StripeConfiguration.NetworkRetriesSleep = true; + StripeConfiguration.StripeClient = null; this.MockHttpClientFixture.Reset(); } diff --git a/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs b/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs index ce70be0cb0..7b30b4b9f4 100644 --- a/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs +++ b/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs @@ -22,7 +22,7 @@ public StripeResponseTest(StripeMockFixture stripeMockFixture) [Fact] public void Date() { - var response = new AccountService().GetSelf().StripeResponse; + var response = new AccountService { Client = this.StripeClient }.GetSelf().StripeResponse; Assert.NotNull(response.Date); } @@ -31,7 +31,7 @@ public void Date() public void IdempotencyKey_Present() { var requestOptions = new RequestOptions { IdempotencyKey = "idempotency_key" }; - var response = new AccountService().GetSelf(requestOptions).StripeResponse; + var response = new AccountService { Client = this.StripeClient }.GetSelf(requestOptions).StripeResponse; Assert.Equal("idempotency_key", response.IdempotencyKey); } @@ -39,7 +39,7 @@ public void IdempotencyKey_Present() [Fact] public void IdempotencyKey_Absent() { - var response = new AccountService().GetSelf().StripeResponse; + var response = new AccountService { Client = this.StripeClient }.GetSelf().StripeResponse; Assert.Null(response.IdempotencyKey); } @@ -47,7 +47,7 @@ public void IdempotencyKey_Absent() [Fact] public void RequestId() { - var response = new AccountService().GetSelf().StripeResponse; + var response = new AccountService { Client = this.StripeClient }.GetSelf().StripeResponse; Assert.NotNull(response.RequestId); } diff --git a/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs b/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs index fdb4370d62..246c1f0878 100644 --- a/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs +++ b/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs @@ -1,5 +1,6 @@ namespace StripeTests { + using System; using System.Linq; using System.Net; using System.Net.Http; @@ -12,11 +13,18 @@ namespace StripeTests using Stripe; using Xunit; - public class SystemNetHttpClientTest : BaseStripeTest + public class SystemNetHttpClientTest : BaseStripeTest, IDisposable { public SystemNetHttpClientTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { + // TODO: don't use StripeConfiguration + StripeConfiguration.StripeClient = this.StripeClient; + } + + public void Dispose() + { + StripeConfiguration.StripeClient = null; } [Fact] diff --git a/src/StripeTests/Infrastructure/StripeExceptionTest.cs b/src/StripeTests/Infrastructure/StripeExceptionTest.cs index 72dbdda363..5b7e47f7e9 100644 --- a/src/StripeTests/Infrastructure/StripeExceptionTest.cs +++ b/src/StripeTests/Infrastructure/StripeExceptionTest.cs @@ -15,7 +15,10 @@ public StripeExceptionTest(StripeMockFixture stripeMockFixture) public async Task SetsStripeResponse() { var exception = await Assert.ThrowsAsync(async () => - await new CouponService().CreateAsync(new CouponCreateOptions())); + { + await new CouponService { Client = this.StripeClient } + .CreateAsync(new CouponCreateOptions()); + }); Assert.NotNull(exception); Assert.NotNull(exception.StripeError); diff --git a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs index 4fff95ce77..8a5a2b3ca9 100644 --- a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs +++ b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs @@ -17,7 +17,7 @@ public AccountLinkServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new AccountLinkService(); + this.service = new AccountLinkService { Client = this.StripeClient }; this.createOptions = new AccountLinkCreateOptions { diff --git a/src/StripeTests/Services/Accounts/AccountServiceTest.cs b/src/StripeTests/Services/Accounts/AccountServiceTest.cs index af81537fc1..bcb3a403ae 100644 --- a/src/StripeTests/Services/Accounts/AccountServiceTest.cs +++ b/src/StripeTests/Services/Accounts/AccountServiceTest.cs @@ -24,7 +24,7 @@ public AccountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new AccountService(); + this.service = new AccountService { Client = this.StripeClient }; this.createOptions = new AccountCreateOptions { diff --git a/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs b/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs index 2857757f17..4c62d2b767 100644 --- a/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs +++ b/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs @@ -20,7 +20,7 @@ public ApplePayDomainServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ApplePayDomainService(); + this.service = new ApplePayDomainService { Client = this.StripeClient }; this.createOptions = new ApplePayDomainCreateOptions { diff --git a/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs b/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs index 960f411ad1..cf266704fa 100644 --- a/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs +++ b/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs @@ -23,7 +23,7 @@ public ApplicationFeeRefundServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ApplicationFeeRefundService(); + this.service = new ApplicationFeeRefundService { Client = this.StripeClient }; this.createOptions = new ApplicationFeeRefundCreateOptions { diff --git a/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs b/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs index 8c7730688e..8a33357bc8 100644 --- a/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs +++ b/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs @@ -19,7 +19,7 @@ public ApplicationFeeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ApplicationFeeService(); + this.service = new ApplicationFeeService { Client = this.StripeClient }; this.listOptions = new ApplicationFeeListOptions { diff --git a/src/StripeTests/Services/AutoPagingTest.cs b/src/StripeTests/Services/AutoPagingTest.cs index ed5b8bb250..51e0a9a964 100644 --- a/src/StripeTests/Services/AutoPagingTest.cs +++ b/src/StripeTests/Services/AutoPagingTest.cs @@ -43,7 +43,7 @@ public void ListAutoPaging() .Throws(new StripeTestException("Unexpected invocation!")); // Call auto-paging method - var service = new PageableService(); + var service = new PageableService { Client = this.StripeClient }; var options = new ListOptions { Limit = 2, diff --git a/src/StripeTests/Services/Balance/BalanceServiceTest.cs b/src/StripeTests/Services/Balance/BalanceServiceTest.cs index f7fa69c393..f9bc07e67d 100644 --- a/src/StripeTests/Services/Balance/BalanceServiceTest.cs +++ b/src/StripeTests/Services/Balance/BalanceServiceTest.cs @@ -16,7 +16,7 @@ public BalanceServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new BalanceService(); + this.service = new BalanceService { Client = this.StripeClient }; } [Fact] diff --git a/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs b/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs index 0aa82db7aa..9411fb8ba8 100644 --- a/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs +++ b/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs @@ -19,7 +19,7 @@ public BalanceTransactionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new BalanceTransactionService(); + this.service = new BalanceTransactionService { Client = this.StripeClient }; this.listOptions = new BalanceTransactionListOptions { diff --git a/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs b/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs index 53c5186792..767ef95448 100644 --- a/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs +++ b/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs @@ -24,7 +24,7 @@ public BankAccountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new BankAccountService(); + this.service = new BankAccountService { Client = this.StripeClient }; this.createOptions = new BankAccountCreateOptions { diff --git a/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs b/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs index fbdd9e7811..0152f19efd 100644 --- a/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs +++ b/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs @@ -21,7 +21,7 @@ public CapabilityServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CapabilityService(); + this.service = new CapabilityService { Client = this.StripeClient }; this.updateOptions = new CapabilityUpdateOptions { diff --git a/src/StripeTests/Services/Cards/CardServiceTest.cs b/src/StripeTests/Services/Cards/CardServiceTest.cs index 6e3cefe253..a54dfe870e 100644 --- a/src/StripeTests/Services/Cards/CardServiceTest.cs +++ b/src/StripeTests/Services/Cards/CardServiceTest.cs @@ -27,7 +27,7 @@ public CardServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CardService(); + this.service = new CardService { Client = this.StripeClient }; this.createOptions = new CardCreateOptions { diff --git a/src/StripeTests/Services/Charges/ChargeServiceTest.cs b/src/StripeTests/Services/Charges/ChargeServiceTest.cs index 48241af564..4a3b4c9867 100644 --- a/src/StripeTests/Services/Charges/ChargeServiceTest.cs +++ b/src/StripeTests/Services/Charges/ChargeServiceTest.cs @@ -23,7 +23,7 @@ public ChargeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ChargeService(); + this.service = new ChargeService { Client = this.StripeClient }; this.captureOptions = new ChargeCaptureOptions { diff --git a/src/StripeTests/Services/Checkout/SessionServiceTest.cs b/src/StripeTests/Services/Checkout/SessionServiceTest.cs index 56cc6643f3..ad47259e9e 100644 --- a/src/StripeTests/Services/Checkout/SessionServiceTest.cs +++ b/src/StripeTests/Services/Checkout/SessionServiceTest.cs @@ -19,7 +19,7 @@ public SessionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SessionService(); + this.service = new SessionService { Client = this.StripeClient }; this.createOptions = new SessionCreateOptions { diff --git a/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs b/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs index b0f4e0f1f7..219a0cd0ba 100644 --- a/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs +++ b/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs @@ -19,7 +19,7 @@ public CountrySpecServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CountrySpecService(); + this.service = new CountrySpecService { Client = this.StripeClient }; this.listOptions = new CountrySpecListOptions { diff --git a/src/StripeTests/Services/Coupons/CouponServiceTest.cs b/src/StripeTests/Services/Coupons/CouponServiceTest.cs index 1c280fd15d..d760f788c8 100644 --- a/src/StripeTests/Services/Coupons/CouponServiceTest.cs +++ b/src/StripeTests/Services/Coupons/CouponServiceTest.cs @@ -22,7 +22,7 @@ public CouponServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CouponService(); + this.service = new CouponService { Client = this.StripeClient }; this.createOptions = new CouponCreateOptions { diff --git a/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs b/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs index f908b74f0e..0321cf2b04 100644 --- a/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs +++ b/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs @@ -23,7 +23,7 @@ public CreditNoteServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CreditNoteService(); + this.service = new CreditNoteService { Client = this.StripeClient }; this.createOptions = new CreditNoteCreateOptions { diff --git a/src/StripeTests/Services/Customers/CustomerServiceTest.cs b/src/StripeTests/Services/Customers/CustomerServiceTest.cs index dd76440d6a..0e3e162eaa 100644 --- a/src/StripeTests/Services/Customers/CustomerServiceTest.cs +++ b/src/StripeTests/Services/Customers/CustomerServiceTest.cs @@ -22,7 +22,7 @@ public CustomerServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CustomerService(); + this.service = new CustomerService { Client = this.StripeClient }; this.createOptions = new CustomerCreateOptions { diff --git a/src/StripeTests/Services/Discounts/DiscountServiceTest.cs b/src/StripeTests/Services/Discounts/DiscountServiceTest.cs index 9150cdc434..45489ce179 100644 --- a/src/StripeTests/Services/Discounts/DiscountServiceTest.cs +++ b/src/StripeTests/Services/Discounts/DiscountServiceTest.cs @@ -16,7 +16,7 @@ public DiscountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new DiscountService(); + this.service = new DiscountService { Client = this.StripeClient }; } [Fact] diff --git a/src/StripeTests/Services/Disputes/DisputeServiceTest.cs b/src/StripeTests/Services/Disputes/DisputeServiceTest.cs index bdbf93c184..0aff50ad86 100644 --- a/src/StripeTests/Services/Disputes/DisputeServiceTest.cs +++ b/src/StripeTests/Services/Disputes/DisputeServiceTest.cs @@ -21,7 +21,7 @@ public DisputeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new DisputeService(); + this.service = new DisputeService { Client = this.StripeClient }; this.updateOptions = new DisputeUpdateOptions { diff --git a/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs b/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs index 73785fd34c..80ec4bcb6a 100644 --- a/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs +++ b/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs @@ -19,7 +19,7 @@ public EphemeralKeyServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new EphemeralKeyService(); + this.service = new EphemeralKeyService { Client = this.StripeClient }; this.createOptions = new EphemeralKeyCreateOptions { diff --git a/src/StripeTests/Services/Events/EventServiceTest.cs b/src/StripeTests/Services/Events/EventServiceTest.cs index 741c134ba5..539c1acbd1 100644 --- a/src/StripeTests/Services/Events/EventServiceTest.cs +++ b/src/StripeTests/Services/Events/EventServiceTest.cs @@ -19,7 +19,7 @@ public EventServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new EventService(); + this.service = new EventService { Client = this.StripeClient }; this.listOptions = new EventListOptions { diff --git a/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs b/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs index df03f0c17b..319e3ab1b8 100644 --- a/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs +++ b/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs @@ -17,7 +17,7 @@ public ExchangeRateServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ExchangeRateService(); + this.service = new ExchangeRateService { Client = this.StripeClient }; this.listOptions = new ExchangeRateListOptions { diff --git a/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs b/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs index f470c40e04..0fce68a09e 100644 --- a/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs +++ b/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs @@ -23,7 +23,7 @@ public ExternalAccountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ExternalAccountService(); + this.service = new ExternalAccountService { Client = this.StripeClient }; this.createOptions = new ExternalAccountCreateOptions { diff --git a/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs b/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs index b8bef032fc..8a8844e439 100644 --- a/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs +++ b/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs @@ -22,7 +22,7 @@ public FileLinkServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new FileLinkService(); + this.service = new FileLinkService { Client = this.StripeClient }; this.createOptions = new FileLinkCreateOptions { diff --git a/src/StripeTests/Services/Files/FileServiceTest.cs b/src/StripeTests/Services/Files/FileServiceTest.cs index c56785a046..660528fd85 100644 --- a/src/StripeTests/Services/Files/FileServiceTest.cs +++ b/src/StripeTests/Services/Files/FileServiceTest.cs @@ -23,7 +23,7 @@ public FileServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new FileService(); + this.service = new FileService { Client = this.StripeClient }; this.createOptions = new FileCreateOptions { diff --git a/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs b/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs index 28ab2ce01e..5c3d5105fa 100644 --- a/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs +++ b/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs @@ -22,7 +22,7 @@ public InvoiceItemServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new InvoiceItemService(); + this.service = new InvoiceItemService { Client = this.StripeClient }; this.createOptions = new InvoiceItemCreateOptions { diff --git a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs index 6db5e7ce8b..97d919cef0 100644 --- a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs +++ b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs @@ -30,7 +30,7 @@ public InvoiceServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new InvoiceService(); + this.service = new InvoiceService { Client = this.StripeClient }; this.createOptions = new InvoiceCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs b/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs index c2e2377112..0b9b770001 100644 --- a/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs @@ -21,7 +21,7 @@ public AuthorizationServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new AuthorizationService(); + this.service = new AuthorizationService { Client = this.StripeClient }; this.updateOptions = new AuthorizationUpdateOptions { diff --git a/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs b/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs index a6d317d95a..b476baf70b 100644 --- a/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs @@ -23,7 +23,7 @@ public CardholderServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CardholderService(); + this.service = new CardholderService { Client = this.StripeClient }; this.createOptions = new CardholderCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs b/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs index 3463127af3..5ee5363523 100644 --- a/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs @@ -22,7 +22,7 @@ public IssuingCardServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CardService(); + this.service = new CardService { Client = this.StripeClient }; this.createOptions = new CardCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs b/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs index 805ef82449..2e7bcb0717 100644 --- a/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs @@ -22,7 +22,7 @@ public IssuingDisputeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new DisputeService(); + this.service = new DisputeService { Client = this.StripeClient }; this.createOptions = new DisputeCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs b/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs index c2522d4118..0f5241c825 100644 --- a/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs @@ -21,7 +21,7 @@ public TransactionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TransactionService(); + this.service = new TransactionService { Client = this.StripeClient }; this.updateOptions = new TransactionUpdateOptions { diff --git a/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs b/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs index 631e88cf51..308951d78f 100644 --- a/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs +++ b/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs @@ -19,7 +19,7 @@ public LoginLinkServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new LoginLinkService(); + this.service = new LoginLinkService { Client = this.StripeClient }; this.createOptions = new LoginLinkCreateOptions { diff --git a/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs b/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs index ce6e0f908d..973e3e0870 100644 --- a/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs +++ b/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs @@ -24,7 +24,7 @@ public OAuthTokenServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new OAuthTokenService(); + this.service = new OAuthTokenService { Client = this.StripeClient }; this.createOptions = new OAuthTokenCreateOptions { @@ -96,7 +96,7 @@ public void AuthorizeUrl_UseClientIdFromStripeClientIfNotProvided() var uri = this.service.AuthorizeUrl(options); var query = this.ParseQueryString(uri.Query); - Assert.Equal(StripeConfiguration.StripeClient.ClientId, query["client_id"]); + Assert.Equal(this.StripeClient.ClientId, query["client_id"]); } [Fact] diff --git a/src/StripeTests/Services/Orders/OrderServiceTest.cs b/src/StripeTests/Services/Orders/OrderServiceTest.cs index 136b533d0c..7de8948d2b 100644 --- a/src/StripeTests/Services/Orders/OrderServiceTest.cs +++ b/src/StripeTests/Services/Orders/OrderServiceTest.cs @@ -23,7 +23,7 @@ public OrderServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new OrderService(); + this.service = new OrderService { Client = this.StripeClient }; this.createOptions = new OrderCreateOptions { diff --git a/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs b/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs index 9c0c1b386d..60b94c5801 100644 --- a/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs +++ b/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs @@ -25,7 +25,7 @@ public PaymentIntentServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PaymentIntentService(); + this.service = new PaymentIntentService { Client = this.StripeClient }; this.cancelOptions = new PaymentIntentCancelOptions { diff --git a/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs b/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs index ddcdc9243b..ab25def79c 100644 --- a/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs +++ b/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs @@ -24,7 +24,7 @@ public PaymentMethodServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PaymentMethodService(); + this.service = new PaymentMethodService { Client = this.StripeClient }; this.attachOptions = new PaymentMethodAttachOptions { diff --git a/src/StripeTests/Services/Payouts/PayoutServiceTest.cs b/src/StripeTests/Services/Payouts/PayoutServiceTest.cs index 779cd87577..619c3fe8a2 100644 --- a/src/StripeTests/Services/Payouts/PayoutServiceTest.cs +++ b/src/StripeTests/Services/Payouts/PayoutServiceTest.cs @@ -22,7 +22,7 @@ public PayoutServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PayoutService(); + this.service = new PayoutService { Client = this.StripeClient }; this.createOptions = new PayoutCreateOptions { diff --git a/src/StripeTests/Services/Persons/PersonServiceTest.cs b/src/StripeTests/Services/Persons/PersonServiceTest.cs index a44591129c..8f669939a5 100644 --- a/src/StripeTests/Services/Persons/PersonServiceTest.cs +++ b/src/StripeTests/Services/Persons/PersonServiceTest.cs @@ -22,7 +22,7 @@ public PersonServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PersonService(); + this.service = new PersonService { Client = this.StripeClient }; this.createOptions = new PersonCreateOptions { diff --git a/src/StripeTests/Services/Plans/PlanServiceTest.cs b/src/StripeTests/Services/Plans/PlanServiceTest.cs index 3706bc8e11..34464774dc 100644 --- a/src/StripeTests/Services/Plans/PlanServiceTest.cs +++ b/src/StripeTests/Services/Plans/PlanServiceTest.cs @@ -22,7 +22,7 @@ public PlanServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PlanService(); + this.service = new PlanService { Client = this.StripeClient }; this.createOptions = new PlanCreateOptions { diff --git a/src/StripeTests/Services/Products/ProductServiceTest.cs b/src/StripeTests/Services/Products/ProductServiceTest.cs index d2c9e4100c..8090bb4615 100644 --- a/src/StripeTests/Services/Products/ProductServiceTest.cs +++ b/src/StripeTests/Services/Products/ProductServiceTest.cs @@ -22,7 +22,7 @@ public ProductServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ProductService(); + this.service = new ProductService { Client = this.StripeClient }; this.createOptions = new ProductCreateOptions { diff --git a/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs b/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs index 1aebeca9e1..0d5eb893b6 100644 --- a/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs +++ b/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs @@ -20,7 +20,7 @@ public EarlyFraudWarningServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new EarlyFraudWarningService(); + this.service = new EarlyFraudWarningService { Client = this.StripeClient }; this.listOptions = new EarlyFraudWarningListOptions { diff --git a/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs b/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs index bca2f57ccb..fdc43e73a3 100644 --- a/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs +++ b/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs @@ -20,7 +20,7 @@ public ValueListItemServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ValueListItemService(); + this.service = new ValueListItemService { Client = this.StripeClient }; this.createOptions = new ValueListItemCreateOptions { diff --git a/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs b/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs index f1ce9a55c3..5510f1b620 100644 --- a/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs +++ b/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs @@ -22,7 +22,7 @@ public ValueListServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ValueListService(); + this.service = new ValueListService { Client = this.StripeClient }; this.createOptions = new ValueListCreateOptions { diff --git a/src/StripeTests/Services/Refunds/RefundServiceTest.cs b/src/StripeTests/Services/Refunds/RefundServiceTest.cs index 50a5a1a9d9..dfaa534329 100644 --- a/src/StripeTests/Services/Refunds/RefundServiceTest.cs +++ b/src/StripeTests/Services/Refunds/RefundServiceTest.cs @@ -22,7 +22,7 @@ public RefundServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new RefundService(); + this.service = new RefundService { Client = this.StripeClient }; this.createOptions = new RefundCreateOptions { diff --git a/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs b/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs index af8a33633a..a3548d8a07 100644 --- a/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs +++ b/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs @@ -21,7 +21,7 @@ public ReportRunServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReportRunService(); + this.service = new ReportRunService { Client = this.StripeClient }; this.createOptions = new ReportRunCreateOptions { diff --git a/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs b/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs index 67de83d195..412eebc466 100644 --- a/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs +++ b/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs @@ -19,7 +19,7 @@ public ReportTypeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReportTypeService(); + this.service = new ReportTypeService { Client = this.StripeClient }; this.listOptions = new ReportTypeListOptions { diff --git a/src/StripeTests/Services/Reviews/ReviewServiceTest.cs b/src/StripeTests/Services/Reviews/ReviewServiceTest.cs index 38f2c6bc59..75f749b562 100644 --- a/src/StripeTests/Services/Reviews/ReviewServiceTest.cs +++ b/src/StripeTests/Services/Reviews/ReviewServiceTest.cs @@ -20,7 +20,7 @@ public ReviewServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReviewService(); + this.service = new ReviewService { Client = this.StripeClient }; this.approveOptions = new ReviewApproveOptions { diff --git a/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs b/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs index c1b4aab52e..de72d04ec3 100644 --- a/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs +++ b/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs @@ -19,7 +19,7 @@ public ScheduledQueryRunServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ScheduledQueryRunService(); + this.service = new ScheduledQueryRunService { Client = this.StripeClient }; this.listOptions = new ScheduledQueryRunListOptions { diff --git a/src/StripeTests/Services/Skus/SkuServiceTest.cs b/src/StripeTests/Services/Skus/SkuServiceTest.cs index df5e263716..3e86050e7b 100644 --- a/src/StripeTests/Services/Skus/SkuServiceTest.cs +++ b/src/StripeTests/Services/Skus/SkuServiceTest.cs @@ -22,7 +22,7 @@ public SkuServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SkuService(); + this.service = new SkuService { Client = this.StripeClient }; this.createOptions = new SkuCreateOptions { diff --git a/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs b/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs index 963b6c11fd..56f09e8ffd 100644 --- a/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs +++ b/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs @@ -19,7 +19,7 @@ public SourceTransactionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SourceTransactionService(); + this.service = new SourceTransactionService { Client = this.StripeClient }; this.listOptions = new SourceTransactionsListOptions { diff --git a/src/StripeTests/Services/Sources/SourceServiceTest.cs b/src/StripeTests/Services/Sources/SourceServiceTest.cs index ce2af05e38..9045c04689 100644 --- a/src/StripeTests/Services/Sources/SourceServiceTest.cs +++ b/src/StripeTests/Services/Sources/SourceServiceTest.cs @@ -26,7 +26,7 @@ public SourceServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SourceService(); + this.service = new SourceService { Client = this.StripeClient }; this.attachOptions = new SourceAttachOptions { diff --git a/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs b/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs index 18d58ba61a..c1a8424479 100644 --- a/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs @@ -22,7 +22,7 @@ public SubscriptionItemServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionItemService(); + this.service = new SubscriptionItemService { Client = this.StripeClient }; this.createOptions = new SubscriptionItemCreateOptions { diff --git a/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs b/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs index ea3bfc1339..cc16255fe2 100644 --- a/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs @@ -20,7 +20,7 @@ public SubscriptionScheduleRevisionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionScheduleRevisionService(); + this.service = new SubscriptionScheduleRevisionService { Client = this.StripeClient }; this.listOptions = new SubscriptionScheduleRevisionListOptions { diff --git a/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs b/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs index 23d1c18f5f..c8fdff6deb 100644 --- a/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs @@ -24,7 +24,7 @@ public SubscriptionScheduleServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionScheduleService(); + this.service = new SubscriptionScheduleService { Client = this.StripeClient }; this.cancelOptions = new SubscriptionScheduleCancelOptions { diff --git a/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs b/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs index 9af67845c2..7b69b2939b 100644 --- a/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs +++ b/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs @@ -23,7 +23,7 @@ public SubscriptionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionService(); + this.service = new SubscriptionService { Client = this.StripeClient }; this.cancelOptions = new SubscriptionCancelOptions { diff --git a/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs b/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs index 0e46ea8ff6..94e7ca3f70 100644 --- a/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs +++ b/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs @@ -21,7 +21,7 @@ public TaxIdServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TaxIdService(); + this.service = new TaxIdService { Client = this.StripeClient }; this.createOptions = new TaxIdCreateOptions { diff --git a/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs b/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs index bb68163db0..cd771d0a75 100644 --- a/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs +++ b/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs @@ -22,7 +22,7 @@ public TaxRateServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TaxRateService(); + this.service = new TaxRateService { Client = this.StripeClient }; this.createOptions = new TaxRateCreateOptions { diff --git a/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs b/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs index 438586b2f6..9b2c5c117a 100644 --- a/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs +++ b/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs @@ -18,7 +18,7 @@ public ConnectionTokenServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ConnectionTokenService(); + this.service = new ConnectionTokenService { Client = this.StripeClient }; this.createOptions = new ConnectionTokenCreateOptions { diff --git a/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs b/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs index 32911b2f8c..61c0a6003a 100644 --- a/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs +++ b/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs @@ -23,7 +23,7 @@ public LocationServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new LocationService(); + this.service = new LocationService { Client = this.StripeClient }; this.createOptions = new LocationCreateOptions { diff --git a/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs b/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs index b18531e539..02c433d30a 100644 --- a/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs +++ b/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs @@ -22,7 +22,7 @@ public ReaderServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReaderService(); + this.service = new ReaderService { Client = this.StripeClient }; this.createOptions = new ReaderCreateOptions { diff --git a/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs b/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs index 56dde62fde..db0da736db 100644 --- a/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs +++ b/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs @@ -17,7 +17,7 @@ public ThreeDSecureServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ThreeDSecureService(); + this.service = new ThreeDSecureService { Client = this.StripeClient }; this.createOptions = new ThreeDSecureCreateOptions { diff --git a/src/StripeTests/Services/Tokens/TokenServiceTest.cs b/src/StripeTests/Services/Tokens/TokenServiceTest.cs index d823451b0c..7c1e098853 100644 --- a/src/StripeTests/Services/Tokens/TokenServiceTest.cs +++ b/src/StripeTests/Services/Tokens/TokenServiceTest.cs @@ -20,7 +20,7 @@ public TokenServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TokenService(); + this.service = new TokenService { Client = this.StripeClient }; this.createOptions = new TokenCreateOptions { diff --git a/src/StripeTests/Services/Topups/TopupServiceTest.cs b/src/StripeTests/Services/Topups/TopupServiceTest.cs index a1774bda34..f5e33d87e2 100644 --- a/src/StripeTests/Services/Topups/TopupServiceTest.cs +++ b/src/StripeTests/Services/Topups/TopupServiceTest.cs @@ -22,7 +22,7 @@ public TopupServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TopupService(); + this.service = new TopupService { Client = this.StripeClient }; this.createOptions = new TopupCreateOptions { diff --git a/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs b/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs index c9a83e4a19..192b4c54b3 100644 --- a/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs +++ b/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs @@ -23,7 +23,7 @@ public TransferReversalServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TransferReversalService(); + this.service = new TransferReversalService { Client = this.StripeClient }; this.createOptions = new TransferReversalCreateOptions { diff --git a/src/StripeTests/Services/Transfers/TransferServiceTest.cs b/src/StripeTests/Services/Transfers/TransferServiceTest.cs index 4cd7e03ad2..dfe4f63e52 100644 --- a/src/StripeTests/Services/Transfers/TransferServiceTest.cs +++ b/src/StripeTests/Services/Transfers/TransferServiceTest.cs @@ -22,7 +22,7 @@ public TransferServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TransferService(); + this.service = new TransferService { Client = this.StripeClient }; this.createOptions = new TransferCreateOptions { diff --git a/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs b/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs index 8851a9be68..1a2d89a8d5 100644 --- a/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs +++ b/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs @@ -18,7 +18,7 @@ public UsageRecordSummaryServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new UsageRecordSummaryService(); + this.service = new UsageRecordSummaryService { Client = this.StripeClient }; this.listOptions = new UsageRecordSummaryListOptions { diff --git a/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs b/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs index ce9c9da515..010835066a 100644 --- a/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs +++ b/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs @@ -18,7 +18,7 @@ public UsageRecordServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new UsageRecordService(); + this.service = new UsageRecordService { Client = this.StripeClient }; this.createOptions = new UsageRecordCreateOptions { diff --git a/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs b/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs index ada3afdc94..403ee861dd 100644 --- a/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs +++ b/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs @@ -22,7 +22,7 @@ public WebhookEndpointServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new WebhookEndpointService(); + this.service = new WebhookEndpointService { Client = this.StripeClient }; this.createOptions = new WebhookEndpointCreateOptions {