diff --git a/SeatsioDotNet.Test/HoldTokens/CreateHoldTokenTest.cs b/SeatsioDotNet.Test/HoldTokens/CreateHoldTokenTest.cs index 35245fb..ca58b17 100644 --- a/SeatsioDotNet.Test/HoldTokens/CreateHoldTokenTest.cs +++ b/SeatsioDotNet.Test/HoldTokens/CreateHoldTokenTest.cs @@ -12,6 +12,15 @@ public void Test() Assert.NotNull(holdToken.Token); CustomAssert.CloseTo(DateTime.Now.AddMinutes(15), holdToken.ExpiresAt); + } + + [Fact] + public void ExpiresInMinutes() + { + var holdToken = Client.HoldTokens.Create(5); + + Assert.NotNull(holdToken.Token); + CustomAssert.CloseTo(DateTime.Now.AddMinutes(5), holdToken.ExpiresAt); } } } \ No newline at end of file diff --git a/SeatsioDotNet/HoldTokens/HoldTokens.cs b/SeatsioDotNet/HoldTokens/HoldTokens.cs index 3ac6a7f..f835bfb 100644 --- a/SeatsioDotNet/HoldTokens/HoldTokens.cs +++ b/SeatsioDotNet/HoldTokens/HoldTokens.cs @@ -18,6 +18,13 @@ public HoldToken Create() return AssertOk(_restClient.Execute(restRequest)); } + public HoldToken Create(int expiresInMinutes) + { + var restRequest = new RestRequest("/hold-tokens", Method.POST) + .AddJsonBody(new {expiresInMinutes}); + return AssertOk(_restClient.Execute(restRequest)); + } + public HoldToken ExpiresInMinutes(string token, int expiresInMinutes) { var restRequest = new RestRequest("/hold-tokens/{token}", Method.POST) diff --git a/SeatsioDotNet/SeatsioDotNet.csproj b/SeatsioDotNet/SeatsioDotNet.csproj index 854ebd5..0360aca 100644 --- a/SeatsioDotNet/SeatsioDotNet.csproj +++ b/SeatsioDotNet/SeatsioDotNet.csproj @@ -2,7 +2,7 @@ Library true - 36 + 37 mroloux;bverbeken Official Seats.io .NET API client Official Seats.io .NET API client