-
Notifications
You must be signed in to change notification settings - Fork 24
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 #238 from Mangopay/improvement/add-rate-limits-test
added test for RateLimits
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
|
||
namespace MangoPay.SDK.Tests | ||
{ | ||
[TestFixture] | ||
public class ApiRateLimitsTest : BaseTest | ||
{ | ||
[Test] | ||
public async Task Test_RateLimits_Retreive() | ||
{ | ||
Assert.IsNull(Api.LastRequestInfo); | ||
|
||
try | ||
{ | ||
await this.GetJohn(); | ||
Assert.IsNotNull(Api.LastRequestInfo); | ||
Assert.IsNotNull(Api.LastRequestInfo.RateLimitingCallsRemaining); | ||
Assert.IsNotNull(Api.LastRequestInfo.RateLimitingTimeTillReset); | ||
Assert.IsNotNull(Api.LastRequestInfo.RateLimitingCallsMade); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Assert.Fail(ex.Message); | ||
} | ||
} | ||
} | ||
} |
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