Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make object instances in tests readonly #1436

Merged
merged 1 commit into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/StripeTests/Infrastructure/ParameterBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace StripeTests

public class ParameterBuilderTest : BaseStripeTest
{
private TestService service;
private readonly TestService service;

public ParameterBuilderTest()
{
Expand Down
2 changes: 1 addition & 1 deletion src/StripeTests/Infrastructure/StripeResponseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace StripeTests

public class StripeResponseTest : BaseStripeTest
{
private StripeList<Charge> charges;
private readonly StripeList<Charge> charges;

public StripeResponseTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace StripeTests

public class AccountCreateOptionsTest : BaseStripeTest
{
private AccountService service;
private readonly AccountService service;

public AccountCreateOptionsTest()
{
Expand Down
10 changes: 5 additions & 5 deletions src/StripeTests/Services/Accounts/AccountServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class AccountServiceTest : BaseStripeTest
{
private const string AccountId = "acct_123";

private AccountService service;
private AccountCreateOptions createOptions;
private AccountUpdateOptions updateOptions;
private AccountListOptions listOptions;
private AccountRejectOptions rejectOptions;
private readonly AccountService service;
private readonly AccountCreateOptions createOptions;
private readonly AccountUpdateOptions updateOptions;
private readonly AccountListOptions listOptions;
private readonly AccountRejectOptions rejectOptions;

public AccountServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public class ApplePayDomainServiceTest : BaseStripeTest
{
private const string DomainId = "apwc_123";

private ApplePayDomainService service;
private ApplePayDomainCreateOptions createOptions;
private ApplePayDomainListOptions listOptions;
private readonly ApplePayDomainService service;
private readonly ApplePayDomainCreateOptions createOptions;
private readonly ApplePayDomainListOptions listOptions;

public ApplePayDomainServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class ApplicationFeeRefundServiceTest : BaseStripeTest
private const string ApplicationFeeId = "fee_123";
private const string ApplicationFeeRefundId = "fr_123";

private ApplicationFeeRefundService service;
private ApplicationFeeRefundCreateOptions createOptions;
private ApplicationFeeRefundUpdateOptions updateOptions;
private ApplicationFeeRefundListOptions listOptions;
private readonly ApplicationFeeRefundService service;
private readonly ApplicationFeeRefundCreateOptions createOptions;
private readonly ApplicationFeeRefundUpdateOptions updateOptions;
private readonly ApplicationFeeRefundListOptions listOptions;

public ApplicationFeeRefundServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class ApplicationFeeServiceTest : BaseStripeTest
{
private const string ApplicationFeeId = "fee_123";

private ApplicationFeeService service;
private ApplicationFeeListOptions listOptions;
private readonly ApplicationFeeService service;
private readonly ApplicationFeeListOptions listOptions;

public ApplicationFeeServiceTest()
{
Expand Down
2 changes: 1 addition & 1 deletion src/StripeTests/Services/Balance/BalanceServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace StripeTests

public class BalanceServiceTest : BaseStripeTest
{
private BalanceService service;
private readonly BalanceService service;

public BalanceServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class BalanceTransactionServiceTest : BaseStripeTest
{
private const string BalanceTransactionId = "txn_123";

private BalanceTransactionService service;
private BalanceTransactionListOptions listOptions;
private readonly BalanceTransactionService service;
private readonly BalanceTransactionListOptions listOptions;

public BalanceTransactionServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace StripeTests

public class BankAccountListOptionsTest : BaseStripeTest
{
private BankAccountService service;
private readonly BankAccountService service;

public BankAccountListOptionsTest()
{
Expand Down
10 changes: 5 additions & 5 deletions src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class BankAccountServiceTest : BaseStripeTest
private const string CustomerId = "cus_123";
private const string BankAccountId = "ba_123";

private BankAccountService service;
private BankAccountCreateOptions createOptions;
private BankAccountUpdateOptions updateOptions;
private BankAccountListOptions listOptions;
private BankAccountVerifyOptions verifyOptions;
private readonly BankAccountService service;
private readonly BankAccountCreateOptions createOptions;
private readonly BankAccountUpdateOptions updateOptions;
private readonly BankAccountListOptions listOptions;
private readonly BankAccountVerifyOptions verifyOptions;

public BankAccountServiceTest()
{
Expand Down
2 changes: 1 addition & 1 deletion src/StripeTests/Services/Cards/CardListOptionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace StripeTests

public class CardListOptionsTest : BaseStripeTest
{
private CardService service;
private readonly CardService service;

public CardListOptionsTest()
{
Expand Down
8 changes: 4 additions & 4 deletions src/StripeTests/Services/Cards/CardServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ public class CardServiceTest : BaseStripeTest
private const string CardId = "card_123";
private const string CustomerId = "cus_123";

private CardService service;
private CardCreateOptions createOptions;
private CardUpdateOptions updateOptions;
private CardListOptions listOptions;
private readonly CardService service;
private readonly CardCreateOptions createOptions;
private readonly CardUpdateOptions updateOptions;
private readonly CardListOptions listOptions;

public CardServiceTest()
{
Expand Down
10 changes: 5 additions & 5 deletions src/StripeTests/Services/Charges/ChargeServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class ChargeServiceTest : BaseStripeTest
{
private const string ChargeId = "ch_123";

private ChargeService service;
private ChargeCaptureOptions captureOptions;
private ChargeCreateOptions createOptions;
private ChargeUpdateOptions updateOptions;
private ChargeListOptions listOptions;
private readonly ChargeService service;
private readonly ChargeCaptureOptions captureOptions;
private readonly ChargeCreateOptions createOptions;
private readonly ChargeUpdateOptions updateOptions;
private readonly ChargeListOptions listOptions;

public ChargeServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class CountrySpecServiceTest : BaseStripeTest
{
private const string CountrySpecId = "US";

private CountrySpecService service;
private CountrySpecListOptions listOptions;
private readonly CountrySpecService service;
private readonly CountrySpecListOptions listOptions;

public CountrySpecServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace StripeTests

public class CouponCreateOptionsTest : BaseStripeTest
{
private CouponService service;
private readonly CouponService service;

public CouponCreateOptionsTest()
{
Expand Down
8 changes: 4 additions & 4 deletions src/StripeTests/Services/Coupons/CouponServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class CouponServiceTest : BaseStripeTest
{
private const string CouponId = "co_123";

private CouponService service;
private CouponCreateOptions createOptions;
private CouponUpdateOptions updateOptions;
private CouponListOptions listOptions;
private readonly CouponService service;
private readonly CouponCreateOptions createOptions;
private readonly CouponUpdateOptions updateOptions;
private readonly CouponListOptions listOptions;

public CouponServiceTest()
{
Expand Down
8 changes: 4 additions & 4 deletions src/StripeTests/Services/Customers/CustomerServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class CustomerServiceTest : BaseStripeTest
{
private const string CustomerId = "cus_123";

private CustomerService service;
private CustomerCreateOptions createOptions;
private CustomerUpdateOptions updateOptions;
private CustomerListOptions listOptions;
private readonly CustomerService service;
private readonly CustomerCreateOptions createOptions;
private readonly CustomerUpdateOptions updateOptions;
private readonly CustomerListOptions listOptions;

public CustomerServiceTest()
{
Expand Down
2 changes: 1 addition & 1 deletion src/StripeTests/Services/Discounts/DiscountServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace StripeTests

public class DiscountServiceTest : BaseStripeTest
{
private DiscountService service;
private readonly DiscountService service;

public DiscountServiceTest()
{
Expand Down
6 changes: 3 additions & 3 deletions src/StripeTests/Services/Disputes/DisputeServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public class DisputeServiceTest : BaseStripeTest
{
private const string DisputeId = "dp_123";

private DisputeService service;
private DisputeUpdateOptions updateOptions;
private DisputeListOptions listOptions;
private readonly DisputeService service;
private readonly DisputeUpdateOptions updateOptions;
private readonly DisputeListOptions listOptions;

public DisputeServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class EphemeralKeyServiceTest : BaseStripeTest
{
private const string EphemeralKeyId = "ephkey_123";

private EphemeralKeyService service;
private EphemeralKeyCreateOptions createOptions;
private readonly EphemeralKeyService service;
private readonly EphemeralKeyCreateOptions createOptions;

public EphemeralKeyServiceTest()
{
Expand Down
4 changes: 2 additions & 2 deletions src/StripeTests/Services/Events/EventServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class EventServiceTest : BaseStripeTest
{
private const string EventId = "evt_123";

private EventService service;
private EventListOptions listOptions;
private readonly EventService service;
private readonly EventListOptions listOptions;

public EventServiceTest()
{
Expand Down
8 changes: 4 additions & 4 deletions src/StripeTests/Services/Events/EventUtilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ namespace StripeTests

public class EventUtilityTest : BaseStripeTest
{
private long eventTimestamp;
private string signature;
private string json;
private string secret;
private readonly long eventTimestamp;
private readonly string signature;
private readonly string json;
private readonly string secret;

public EventUtilityTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace StripeTests

public class ExchangeRateServiceTest : BaseStripeTest
{
private ExchangeRateService service;
private ExchangeRateListOptions listOptions;
private readonly ExchangeRateService service;
private readonly ExchangeRateListOptions listOptions;

public ExchangeRateServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class ExternalAccountServiceTest : BaseStripeTest
private const string AccountId = "acct_123";
private const string ExternalAccountId = "ba_123";

private ExternalAccountService service;
private ExternalAccountCreateOptions createOptions;
private ExternalAccountUpdateOptions updateOptions;
private ExternalAccountListOptions listOptions;
private readonly ExternalAccountService service;
private readonly ExternalAccountCreateOptions createOptions;
private readonly ExternalAccountUpdateOptions updateOptions;
private readonly ExternalAccountListOptions listOptions;

public ExternalAccountServiceTest()
{
Expand Down
8 changes: 4 additions & 4 deletions src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class FileLinkServiceTest : BaseStripeTest
{
private const string FileLinkId = "link_123";

private FileLinkService service;
private FileLinkCreateOptions createOptions;
private FileLinkUpdateOptions updateOptions;
private FileLinkListOptions listOptions;
private readonly FileLinkService service;
private readonly FileLinkCreateOptions createOptions;
private readonly FileLinkUpdateOptions updateOptions;
private readonly FileLinkListOptions listOptions;

public FileLinkServiceTest()
{
Expand Down
6 changes: 3 additions & 3 deletions src/StripeTests/Services/Files/FileServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class FileServiceTest : BaseStripeTest
private const string FileId = "file_123";
private const string FileName = "StripeTests.Resources.file_upload_logo.png";

private FileService service;
private FileCreateOptions createOptions;
private FileListOptions listOptions;
private readonly FileService service;
private readonly FileCreateOptions createOptions;
private readonly FileListOptions listOptions;

public FileServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class InvoiceItemServiceTest : BaseStripeTest
{
private const string InvoiceItemId = "ii_123";

private InvoiceItemService service;
private InvoiceItemCreateOptions createOptions;
private InvoiceItemUpdateOptions updateOptions;
private InvoiceItemListOptions listOptions;
private readonly InvoiceItemService service;
private readonly InvoiceItemCreateOptions createOptions;
private readonly InvoiceItemUpdateOptions updateOptions;
private readonly InvoiceItemListOptions listOptions;

public InvoiceItemServiceTest()
{
Expand Down
24 changes: 12 additions & 12 deletions src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ public class InvoiceServiceTest : BaseStripeTest
{
private const string InvoiceId = "in_123";

private InvoiceService service;
private InvoiceCreateOptions createOptions;
private InvoiceUpdateOptions updateOptions;
private InvoicePayOptions payOptions;
private InvoiceListOptions listOptions;
private InvoiceListLineItemsOptions listLineItemsOptions;
private UpcomingInvoiceOptions upcomingOptions;
private UpcomingInvoiceListLineItemsOptions upcomingListLineItemsOptions;
private InvoiceFinalizeOptions finalizeOptions;
private InvoiceMarkUncollectibleOptions markUncollectibleOptions;
private InvoiceSendOptions sendOptions;
private InvoiceVoidOptions voidOptions;
private readonly InvoiceService service;
private readonly InvoiceCreateOptions createOptions;
private readonly InvoiceUpdateOptions updateOptions;
private readonly InvoicePayOptions payOptions;
private readonly InvoiceListOptions listOptions;
private readonly InvoiceListLineItemsOptions listLineItemsOptions;
private readonly UpcomingInvoiceOptions upcomingOptions;
private readonly UpcomingInvoiceListLineItemsOptions upcomingListLineItemsOptions;
private readonly InvoiceFinalizeOptions finalizeOptions;
private readonly InvoiceMarkUncollectibleOptions markUncollectibleOptions;
private readonly InvoiceSendOptions sendOptions;
private readonly InvoiceVoidOptions voidOptions;

public InvoiceServiceTest()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public class AuthorizationServiceTest : BaseStripeTest
{
private const string AuthorizationId = "iauth_123";

private AuthorizationService service;
private AuthorizationUpdateOptions updateOptions;
private AuthorizationListOptions listOptions;
private readonly AuthorizationService service;
private readonly AuthorizationUpdateOptions updateOptions;
private readonly AuthorizationListOptions listOptions;

public AuthorizationServiceTest()
{
Expand Down
Loading