-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from AdrianJSClark/2-league-get
Implement "league/get" Endpoint
- Loading branch information
Showing
33 changed files
with
501 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,4 +315,36 @@ public async Task GetMemberRecentRacesSucceedsAsync() | |
Assert.That(memberStats.TotalRateLimit, Is.EqualTo(100)); | ||
Assert.That(memberStats.RateLimitReset, Is.EqualTo(new DateTimeOffset(2022, 2, 10, 0, 0, 0, TimeSpan.Zero))); | ||
} | ||
|
||
[Test(TestOf = typeof(iRacingDataClient))] | ||
public async Task GetLeagueWithLicensesSucceedsAsync() | ||
{ | ||
await MessageHandler.QueueResponsesAsync(nameof(GetLeagueWithLicensesSucceedsAsync)).ConfigureAwait(false); | ||
await sut.LoginAsync("[email protected]", "SuperSecretPassword", CancellationToken.None).ConfigureAwait(false); | ||
|
||
var memberStats = await sut.GetLeagueAsync(123, true).ConfigureAwait(false); | ||
|
||
Assert.That(memberStats, Is.Not.Null); | ||
Assert.That(memberStats!.Data, Is.Not.Null); | ||
|
||
Assert.That(memberStats.RateLimitRemaining, Is.EqualTo(99)); | ||
Assert.That(memberStats.TotalRateLimit, Is.EqualTo(100)); | ||
Assert.That(memberStats.RateLimitReset, Is.EqualTo(new DateTimeOffset(2022, 2, 10, 0, 0, 0, TimeSpan.Zero))); | ||
} | ||
|
||
[Test(TestOf = typeof(iRacingDataClient))] | ||
public async Task GetLeagueWithoutLicensesSucceedsAsync() | ||
{ | ||
await MessageHandler.QueueResponsesAsync(nameof(GetLeagueWithoutLicensesSucceedsAsync)).ConfigureAwait(false); | ||
await sut.LoginAsync("[email protected]", "SuperSecretPassword", CancellationToken.None).ConfigureAwait(false); | ||
|
||
var memberStats = await sut.GetLeagueAsync(123, false).ConfigureAwait(false); | ||
|
||
Assert.That(memberStats, Is.Not.Null); | ||
Assert.That(memberStats!.Data, Is.Not.Null); | ||
|
||
Assert.That(memberStats.RateLimitRemaining, Is.EqualTo(99)); | ||
Assert.That(memberStats.TotalRateLimit, Is.EqualTo(100)); | ||
Assert.That(memberStats.RateLimitReset, Is.EqualTo(new DateTimeOffset(2022, 2, 10, 0, 0, 0, TimeSpan.Zero))); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Aydsko.iRacingData.UnitTests/Responses/GetLeagueWithLicensesSucceedsAsync/0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"headers": {}, | ||
"content": { | ||
"authcode": "51687dfd-1d8e-4faa-bf72-52cb36e4f762", | ||
"autoLoginSeries": null, | ||
"autoLoginToken": null, | ||
"custId": 123456, | ||
"email": "[email protected]", | ||
"ssoCookieDomain": ".iracing.com", | ||
"ssoCookieName": "irsso_membersv2", | ||
"ssoCookiePath": "/", | ||
"ssoCookieValue": "3883fc6a-890c-4c75-981c-84f2f9ebfb41" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Aydsko.iRacingData.UnitTests/Responses/GetLeagueWithLicensesSucceedsAsync/1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"headers": { | ||
"x-ratelimit-remaining": "99", | ||
"x-ratelimit-limit": "100", | ||
"x-ratelimit-reset": "1644451200" | ||
}, | ||
"content": { | ||
"link": "https://scorpio-assets.s3.amazonaws.com/production/data-server/cache/data-services/league/get/e0a56003-c609-4a0e-a1d2-8fc4dcab92a6?AWSAccessKeyId=AKIAUO6OO4A3357USLO7&Expires=1642767750&Signature=XpwNF2L921Ry%2Frr%2FbATcfi2TyHY%3D" | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
src/Aydsko.iRacingData.UnitTests/Responses/GetLeagueWithLicensesSucceedsAsync/2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"headers": {}, | ||
"content": { | ||
"league_id": 8234, | ||
"owner_id": 341554, | ||
"league_name": "Adrian's Test League", | ||
"created": "2022-03-05T12:43:53Z", | ||
"hidden": false, | ||
"message": "https://iracing.adrianclark.dev", | ||
"about": "Adrian's league for testing things.", | ||
"url": "https://iracing.adrianclark.dev", | ||
"recruiting": false, | ||
"private_wall": false, | ||
"private_roster": false, | ||
"private_schedule": false, | ||
"private_results": false, | ||
"roster_count": 1, | ||
"owner": { | ||
"cust_id": 341554, | ||
"display_name": "Adrian Clark", | ||
"helmet": { | ||
"pattern": 50, | ||
"color1": "981F24", | ||
"color2": "000000", | ||
"color3": "ED2129", | ||
"face_type": 0, | ||
"helmet_type": 0 | ||
}, | ||
"car_number": null, | ||
"nick_name": null | ||
}, | ||
"image": { | ||
"small_logo": null, | ||
"large_logo": null | ||
}, | ||
"tags": { | ||
"categorized": [ | ||
{ | ||
"category_id": 1, | ||
"name": "Culture", | ||
"limit": 1, | ||
"tags": [ | ||
{ | ||
"tag_id": 5, | ||
"tag_name": "Professional" | ||
} | ||
] | ||
}, | ||
{ | ||
"category_id": 2, | ||
"name": "Type of Racing", | ||
"limit": null, | ||
"tags": [ | ||
{ | ||
"tag_id": 8, | ||
"tag_name": "Road" | ||
}, | ||
{ | ||
"tag_id": 10, | ||
"tag_name": "Grand-Prix" | ||
} | ||
] | ||
}, | ||
{ | ||
"category_id": 3, | ||
"name": "Car Setup", | ||
"limit": null, | ||
"tags": [ | ||
{ | ||
"tag_id": 12, | ||
"tag_name": "Open-Setup" | ||
} | ||
] | ||
} | ||
], | ||
"not_categorized": [] | ||
}, | ||
"roster": [ | ||
{ | ||
"cust_id": 341554, | ||
"display_name": "Adrian Clark", | ||
"helmet": { | ||
"pattern": 50, | ||
"color1": "981F24", | ||
"color2": "000000", | ||
"color3": "ED2129", | ||
"face_type": 0, | ||
"helmet_type": 0 | ||
}, | ||
"owner": true, | ||
"admin": true, | ||
"league_mail_opt_out": false, | ||
"league_pm_opt_out": false, | ||
"league_member_since": "2022-03-05T12:43:53Z", | ||
"car_number": null, | ||
"nick_name": null | ||
} | ||
] | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Aydsko.iRacingData.UnitTests/Responses/GetLeagueWithoutLicensesSucceedsAsync/0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"headers": {}, | ||
"content": { | ||
"authcode": "51687dfd-1d8e-4faa-bf72-52cb36e4f762", | ||
"autoLoginSeries": null, | ||
"autoLoginToken": null, | ||
"custId": 123456, | ||
"email": "[email protected]", | ||
"ssoCookieDomain": ".iracing.com", | ||
"ssoCookieName": "irsso_membersv2", | ||
"ssoCookiePath": "/", | ||
"ssoCookieValue": "3883fc6a-890c-4c75-981c-84f2f9ebfb41" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Aydsko.iRacingData.UnitTests/Responses/GetLeagueWithoutLicensesSucceedsAsync/1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"headers": { | ||
"x-ratelimit-remaining": "99", | ||
"x-ratelimit-limit": "100", | ||
"x-ratelimit-reset": "1644451200" | ||
}, | ||
"content": { | ||
"link": "https://scorpio-assets.s3.amazonaws.com/production/data-server/cache/data-services/stats/member_recent_races/e0a56003-c609-4a0e-a1d2-8fc4dcab92a6?AWSAccessKeyId=AKIAUO6OO4A3357USLO7&Expires=1642767750&Signature=XpwNF2L921Ry%2Frr%2FbATcfi2TyHY%3D" | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
src/Aydsko.iRacingData.UnitTests/Responses/GetLeagueWithoutLicensesSucceedsAsync/2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"headers": {}, | ||
"content": { | ||
"league_id": 8234, | ||
"owner_id": 341554, | ||
"league_name": "Adrian's Test League", | ||
"created": "2022-03-05T12:43:53Z", | ||
"hidden": false, | ||
"message": "https://iracing.adrianclark.dev", | ||
"about": "Adrian's league for testing things.", | ||
"url": "https://iracing.adrianclark.dev", | ||
"recruiting": false, | ||
"private_wall": false, | ||
"private_roster": false, | ||
"private_schedule": false, | ||
"private_results": false, | ||
"roster_count": 1, | ||
"owner": { | ||
"cust_id": 341554, | ||
"display_name": "Adrian Clark", | ||
"helmet": { | ||
"pattern": 50, | ||
"color1": "981F24", | ||
"color2": "000000", | ||
"color3": "ED2129", | ||
"face_type": 0, | ||
"helmet_type": 0 | ||
}, | ||
"car_number": null, | ||
"nick_name": null | ||
}, | ||
"image": { | ||
"small_logo": null, | ||
"large_logo": null | ||
}, | ||
"tags": { | ||
"categorized": [ | ||
{ | ||
"category_id": 1, | ||
"name": "Culture", | ||
"limit": 1, | ||
"tags": [ | ||
{ | ||
"tag_id": 5, | ||
"tag_name": "Professional" | ||
} | ||
] | ||
}, | ||
{ | ||
"category_id": 2, | ||
"name": "Type of Racing", | ||
"limit": null, | ||
"tags": [ | ||
{ | ||
"tag_id": 8, | ||
"tag_name": "Road" | ||
}, | ||
{ | ||
"tag_id": 10, | ||
"tag_name": "Grand-Prix" | ||
} | ||
] | ||
}, | ||
{ | ||
"category_id": 3, | ||
"name": "Car Setup", | ||
"limit": null, | ||
"tags": [ | ||
{ | ||
"tag_id": 12, | ||
"tag_name": "Open-Setup" | ||
} | ||
] | ||
} | ||
], | ||
"not_categorized": [] | ||
}, | ||
"roster": [ | ||
{ | ||
"cust_id": 341554, | ||
"display_name": "Adrian Clark", | ||
"helmet": { | ||
"pattern": 50, | ||
"color1": "981F24", | ||
"color2": "000000", | ||
"color3": "ED2129", | ||
"face_type": 0, | ||
"helmet_type": 0 | ||
}, | ||
"owner": true, | ||
"admin": true, | ||
"league_mail_opt_out": false, | ||
"league_pm_opt_out": false, | ||
"league_member_since": "2022-03-05T12:43:53Z", | ||
"car_number": null, | ||
"nick_name": null | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.