Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from syncromatics/fix/EN-4115-remove-prefix-mak…
Browse files Browse the repository at this point in the history
…e-stopid-string

(+semver: breaking) remove stop id prefix
  • Loading branch information
k-grant authored Feb 8, 2019
2 parents e851eec + 61441f7 commit 3919654
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public HoustonMetroClient(ClientSettings clientSettings)
_client = new RestClient(httpClient).For<IHoustonMetroApi>();
}

public Task<Response<Arrival>> GetArrivalsAsync(int stopId) =>
public Task<Response<Arrival>> GetArrivalsAsync(string stopId) =>
_client.GetArrivalsAsync(_settings.ApiKey, stopId);

public Task<Response<Route>> GetRoutesAsync(int stopId) =>
public Task<Response<Route>> GetRoutesAsync(string stopId) =>
_client.GetRoutesAsync(_settings.ApiKey, stopId);
}
}
8 changes: 4 additions & 4 deletions src/Syncromatics.Clients.HoustonMetro.Api/IHoustonMetroApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace Syncromatics.Clients.HoustonMetro.Api
{
internal interface IHoustonMetroApi
{
[Get("data/Stops('MeTrAuOfHaCo_{stopId}')/Arrivals?$format=json")]
[Get("data/Stops('{stopId}')/Arrivals?$format=json")]
Task<Response<Arrival>> GetArrivalsAsync(
[Header("Ocp-Apim-Subscription-Key")]string apiKey,
[Path]int stopId);
[Path]string stopId);

[Get("data/Stops('MeTrAuOfHaCo_{stopId}')/Routes?$format=json")]
[Get("data/Stops('{stopId}')/Routes?$format=json")]
Task<Response<Route>> GetRoutesAsync(
[Header("Ocp-Apim-Subscription-Key")]string apiKey,
[Path]int stopId);
[Path]string stopId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Syncromatics.Clients.HoustonMetro.Api
{
public interface IHoustonMetroClient
{
Task<Response<Arrival>> GetArrivalsAsync(int stopId);
Task<Response<Route>> GetRoutesAsync(int stopId);
Task<Response<Arrival>> GetArrivalsAsync(string stopId);
Task<Response<Route>> GetRoutesAsync(string stopId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public HoustonMetroClientTests()
}

[Theory]
[InlineData(79)]
[InlineData(244)]
[InlineData(661)]
[InlineData(681)]
[InlineData(9045)]
[InlineData(9953)]
[InlineData(10055)]
public async Task ShouldGetArrivals(int stopId)
[InlineData("MeTrAuOfHaCo_79")]
[InlineData("MeTrAuOfHaCo_244")]
[InlineData("MeTrAuOfHaCo_661")]
[InlineData("MeTrAuOfHaCo_681")]
[InlineData("MeTrAuOfHaCo_9045")]
[InlineData("MeTrAuOfHaCo_9953")]
[InlineData("MeTrAuOfHaCo_10055")]
public async Task ShouldGetArrivals(string stopId)
{
Response<Arrival> result = null;
await RetryPolicy().ExecuteAsync(async () =>
Expand All @@ -48,14 +48,14 @@ await RetryPolicy().ExecuteAsync(async () =>
}

[Theory]
[InlineData(79)]
[InlineData(244)]
[InlineData(661)]
[InlineData(681)]
[InlineData(9045)]
[InlineData(9953)]
[InlineData(10055)]
public async Task ShouldGetRoutes(int stopId)
[InlineData("MeTrAuOfHaCo_79")]
[InlineData("MeTrAuOfHaCo_244")]
[InlineData("MeTrAuOfHaCo_661")]
[InlineData("MeTrAuOfHaCo_681")]
[InlineData("MeTrAuOfHaCo_9045")]
[InlineData("MeTrAuOfHaCo_9953")]
[InlineData("MeTrAuOfHaCo_10055")]
public async Task ShouldGetRoutes(string stopId)
{
Response<Route> result = null;
await RetryPolicy().ExecuteAsync(async () =>
Expand Down

0 comments on commit 3919654

Please sign in to comment.