-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d1f155
commit e109320
Showing
5 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
Criipto.Signatures.IntegrationTests/ExtendSignatureOrderTests.cs
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,49 @@ | ||
using Xunit; | ||
using Criipto.Signatures; | ||
using Criipto.Signatures.Models; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System; | ||
namespace Criipto.Signatures.IntegrationTests; | ||
|
||
public class ExtendSignatureOrderTests | ||
{ | ||
[Fact] | ||
public async void MutationReturnsSignatureOrder() | ||
{ | ||
using (var client = new CriiptoSignaturesClient(Dsl.CLIENT_ID, Dsl.CLIENT_SECRET, "test")) | ||
{ | ||
// Arrange | ||
var signatureOrder = await client.CreateSignatureOrder( | ||
new CreateSignatureOrderInput() | ||
{ | ||
title = "Title", | ||
expiresInDays = 1, | ||
documents = new List<DocumentInput>(){ | ||
new DocumentInput { | ||
pdf = | ||
new PadesDocumentInput | ||
{ | ||
title = "TEST", | ||
blob = Dsl.Sample | ||
} | ||
} | ||
} | ||
} | ||
); | ||
|
||
// Act | ||
var actual = await client.ExtendSignatureOrder( | ||
signatureOrder, | ||
new ExtendSignatureOrderInput | ||
{ | ||
additionalExpirationInDays = 7 | ||
} | ||
); | ||
|
||
// Assert | ||
Assert.NotNull(actual?.id); | ||
Assert.Equal(DateTimeOffset.Parse(actual!.expiresAt), DateTimeOffset.Parse(signatureOrder.expiresAt).AddDays(7)); | ||
} | ||
} | ||
} |
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