Skip to content

Commit

Permalink
Merge pull request #1447 from stripe/ob-minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
ob-stripe authored Dec 22, 2018
2 parents 662911e + 8717176 commit 839e46e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,10 @@ private static List<Parameter> FlattenParamsList(List<object> list, string keyPr
}
else
{
var listEnumerator = list.GetEnumerator();

for (int i = 0; listEnumerator.MoveNext() == true; i++)
foreach (var item in list.Select((value, index) => new { value, index }))
{
object value = listEnumerator.Current;
string newPrefix = $"{keyPrefix}[{i}]";
flatParams.AddRange(FlattenParamsValue(value, newPrefix));
string newPrefix = $"{keyPrefix}[{item.index}]";
flatParams.AddRange(FlattenParamsValue(item.value, newPrefix));
}
}

Expand Down
6 changes: 0 additions & 6 deletions src/Stripe.net/Infrastructure/ParameterBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ public static string ApplyAllParameters<T>(this Service<T> service, BaseOptions
}

requestString = ApplyParameterToUrl(requestString, "expand[]", expandPropertyName);

// note: I had no idea you could expand properties beyond the first level (up to 4 before stripe throws an exception).
// something to consider adding to the project.
//
// example:
// requestString = ApplyParameterToUrl(requestString, "expand[]", "data.charge.dispute.charge.dispute.charge.dispute");
}
}

Expand Down
1 change: 0 additions & 1 deletion src/StripeTests/Infrastructure/ParameterBuilderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ public void SetsUrl()
{
Assert.NotNull(this.service);

var testObject = new TestOptions();
var url = this.service.ApplyAllParameters(null, "base_url", false);
Assert.Equal("base_url", url);
}
Expand Down
4 changes: 2 additions & 2 deletions src/StripeTests/MockHttpClientFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace StripeTests

public class MockHttpClientFixture : IDisposable
{
private Mock<HttpClientHandler> mockHandler;
private readonly Mock<HttpClientHandler> mockHandler;

private HttpMessageHandler origHandler;
private readonly HttpMessageHandler origHandler;

public MockHttpClientFixture()
{
Expand Down
8 changes: 4 additions & 4 deletions src/StripeTests/StripeMockFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class StripeMockFixture : IDisposable
/// </remarks>
private const string MockMinimumVersion = "0.39.0";

private string origApiBase;
private string origFilesBase;
private string origApiKey;
private readonly string origApiBase;
private readonly string origFilesBase;
private readonly string origApiKey;

private string port;
private readonly string port;

public StripeMockFixture()
{
Expand Down

0 comments on commit 839e46e

Please sign in to comment.