From a3e8635babda05a2533e7de8651c075529386d3d Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Tue, 29 Jan 2019 21:47:05 +0100 Subject: [PATCH] Minor fixes --- .../JsonConverters/ExpandableFieldConverter.cs | 2 +- src/Stripe.net/Infrastructure/StringUtils.cs | 2 +- .../Services/AccountLinks/AccountLinkServiceTest.cs | 6 +++--- src/StripeTests/Services/AutoPagingTest.cs | 2 +- src/StripeTests/Services/Events/EventUtilityTest.cs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Stripe.net/Infrastructure/JsonConverters/ExpandableFieldConverter.cs b/src/Stripe.net/Infrastructure/JsonConverters/ExpandableFieldConverter.cs index 41be1966ec..99ed026f2f 100644 --- a/src/Stripe.net/Infrastructure/JsonConverters/ExpandableFieldConverter.cs +++ b/src/Stripe.net/Infrastructure/JsonConverters/ExpandableFieldConverter.cs @@ -44,7 +44,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s default: throw new JsonSerializationException(string.Format( "Unexpected value when converting ExpandableField. Expected IExpandableField, got {0}.", - value.GetType().ToString())); + value.GetType())); } } diff --git a/src/Stripe.net/Infrastructure/StringUtils.cs b/src/Stripe.net/Infrastructure/StringUtils.cs index 401f43daef..742e8cbd9a 100644 --- a/src/Stripe.net/Infrastructure/StringUtils.cs +++ b/src/Stripe.net/Infrastructure/StringUtils.cs @@ -2,7 +2,7 @@ namespace Stripe.Infrastructure { using System.Text.RegularExpressions; - internal class StringUtils + internal static class StringUtils { /// Converts the string to snake case. /// The string to convert. diff --git a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs index 67590d8dcf..90444d38e5 100644 --- a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs +++ b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs @@ -9,15 +9,15 @@ namespace StripeTests public class AccountLinkServiceTest : BaseStripeTest { - private AccountLinkService service; - private AccountLinkCreateOptions createOptions; + private readonly AccountLinkService service; + private readonly AccountLinkCreateOptions createOptions; public AccountLinkServiceTest(MockHttpClientFixture mockHttpClientFixture) : base(mockHttpClientFixture) { this.service = new AccountLinkService(); - this.createOptions = new AccountLinkCreateOptions() + this.createOptions = new AccountLinkCreateOptions { AccountId = "acct_123", Collect = "eventually_due", diff --git a/src/StripeTests/Services/AutoPagingTest.cs b/src/StripeTests/Services/AutoPagingTest.cs index 831bee3b10..af859b47ca 100644 --- a/src/StripeTests/Services/AutoPagingTest.cs +++ b/src/StripeTests/Services/AutoPagingTest.cs @@ -45,7 +45,7 @@ public void ListAutoPaging() // Call auto-paging method var service = new PageableService(); - var options = new ListOptions() + var options = new ListOptions { Limit = 2, }; diff --git a/src/StripeTests/Services/Events/EventUtilityTest.cs b/src/StripeTests/Services/Events/EventUtilityTest.cs index c27830116a..0276875fee 100644 --- a/src/StripeTests/Services/Events/EventUtilityTest.cs +++ b/src/StripeTests/Services/Events/EventUtilityTest.cs @@ -77,9 +77,9 @@ public void AcceptsExpectedApiVersion() { var evt = Event.FromJson(this.json); evt.ApiVersion = StripeConfiguration.ApiVersion; - var json = evt.ToJson(); + var serialized = evt.ToJson(); - evt = EventUtility.ParseEvent(json); + evt = EventUtility.ParseEvent(serialized); Assert.Equal(StripeConfiguration.ApiVersion, evt.ApiVersion); }