Skip to content

Commit

Permalink
Resolve VCSWP-19571 (Fix test bug for csharp sdk) (#45)
Browse files Browse the repository at this point in the history
* Fix test bug for csharp sdk

* Extract timestamp into global variable for csharp sdk
  • Loading branch information
amahadaya authored May 1, 2023
1 parent 11e5ec8 commit cbe2c88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/freeclimb.Test/Utils/SignatureInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ public class SignatureInformationTests : IDisposable
{
// TODO uncomment below to declare an instance variable for AccountRequest
private SignatureInformation instance;
private int timestamp = 1679944186;

public SignatureInformationTests()
{
string requestHeader = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8";
string requestHeader = "t=" + timestamp.ToString() + ",v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8";
instance = new SignatureInformation(requestHeader);
}

Expand Down Expand Up @@ -47,7 +48,7 @@ public void isRequestTimeValidTest()
public void isRequestTimeValidTest2()
{
//For test purposes, this relates to three days, we also want to ensure that the signature header remains the same during tests
int tolerance = 5 * 60 * 10000;
int tolerance = Int32.MaxValue - timestamp;
Boolean isRequestTimeValid = instance.isRequestTimeValid(tolerance);
Assert.Equal<Boolean>(isRequestTimeValid, false);
}
Expand Down

0 comments on commit cbe2c88

Please sign in to comment.