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

Minor fixes #1447

Merged
merged 1 commit into from
Dec 22, 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
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