Skip to content

Commit

Permalink
Merge pull request #238 from Mangopay/improvement/add-rate-limits-test
Browse files Browse the repository at this point in the history
added test for RateLimits
  • Loading branch information
iulian03 authored Jan 27, 2025
2 parents dcd7e4d + 52118a9 commit d51557b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
29 changes: 29 additions & 0 deletions MangoPay.SDK.Tests/ApiRateLimitsTest.cs
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);
}
}
}
}
2 changes: 1 addition & 1 deletion MangoPay.SDK.Tests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ protected async Task<string> GetPaylineCorrectRegistartionData(CardRegistrationD
request.AddParameter("data", cardRegistration.PreregistrationData);
request.AddParameter("accessKeyRef", cardRegistration.AccessKey);
request.AddParameter("cardNumber", "4970107111111119");
request.AddParameter("cardExpirationDate", "1224");
request.AddParameter("cardExpirationDate", "1229");
request.AddParameter("cardCvx", "123");

// Payline requires TLS
Expand Down
5 changes: 5 additions & 0 deletions MangoPay.SDK/Entities/POST/RefundTransferPostDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public RefundTransferPostDTO(string authorId, Money fees, Money debitedFunds)
Fees = fees;
DebitedFunds = debitedFunds;
}

public RefundTransferPostDTO(string authorId)
{
AuthorId = authorId;
}

/// <summary>Author identifier.</summary>
public string AuthorId { get; set; }
Expand Down

0 comments on commit d51557b

Please sign in to comment.