Skip to content

Commit

Permalink
[Bug] Fix GetCurrentFees now returning a single Fee object (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
mailgerigk authored and dougdellolio committed Nov 22, 2019
1 parent f1d98f6 commit 319f810
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ public static class FeesResponseFixture
public static string Create()
{
var json = @"
[
{
""maker_fee_rate"": ""0.0015"",
""taker_fee_rate"": ""0.0025"",
""usd_volume"": ""25000.00""
}
]";
{
""maker_fee_rate"": ""0.0015"",
""taker_fee_rate"": ""0.0025"",
""usd_volume"": ""25000.00""
}";

return json;
}
Expand Down
8 changes: 4 additions & 4 deletions CoinbasePro.Specs/Services/Fees/FeesServiceSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FeesServiceSpecs : WithSubject<FeesService>

class when_getting_current_fees
{
static IEnumerable<Fee> fee_response;
static Fee fee_response;

Establish context = () =>
The<IHttpClient>().WhenToldTo(p => p.ReadAsStringAsync(Param.IsAny<HttpResponseMessage>()))
Expand All @@ -35,9 +35,9 @@ class when_getting_current_fees

It should_return_a_correct_response = () =>
{
fee_response.First().MakerFeeRate.ShouldEqual(0.0015m);
fee_response.First().TakerFeeRate.ShouldEqual(0.0025m);
fee_response.First().UsdVolume.ShouldEqual(25000);
fee_response.MakerFeeRate.ShouldEqual(0.0015m);
fee_response.TakerFeeRate.ShouldEqual(0.0025m);
fee_response.UsdVolume.ShouldEqual(25000);
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions CoinbasePro/Services/Fees/FeesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public FeesService(
{
}

public async Task<IEnumerable<Fee>> GetCurrentFeesAsync()
public async Task<Fee> GetCurrentFeesAsync()
{
var fees = await SendServiceCall<IEnumerable<Fee>>(HttpMethod.Get, "/fees");
var fees = await SendServiceCall<Fee>(HttpMethod.Get, "/fees");

return fees;
}
Expand Down
2 changes: 1 addition & 1 deletion CoinbasePro/Services/Fees/IFeesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ namespace CoinbasePro.Services.Fees
{
public interface IFeesService
{
Task<IEnumerable<Fee>> GetCurrentFeesAsync();
Task<Fee> GetCurrentFeesAsync();
}
}

0 comments on commit 319f810

Please sign in to comment.