-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathGetTheDocumentHistory.cs
More file actions
33 lines (29 loc) · 1.17 KB
/
GetTheDocumentHistory.cs
File metadata and controls
33 lines (29 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace SignNow.Net.Examples
{
public partial class DocumentExamples
{
[TestMethod]
public async Task GetTheDocumentHistoryAsync()
{
// upload a document with a signature field
await using var fileStream = File.OpenRead(PdfWithSignatureField);
var document = await testContext.Documents
.UploadDocumentWithFieldExtractAsync(fileStream, "GetTheDocumentHistory.pdf")
.ConfigureAwait(false);
// get the document history
var documentHistory = await testContext.Documents
.GetDocumentHistoryAsync(document?.Id)
.ConfigureAwait(false);
// check the document history
Assert.IsTrue(documentHistory.All(item => item.DocumentId == document?.Id));
Assert.IsTrue(documentHistory.Any(item => item.Origin == "original"));
Assert.IsTrue(documentHistory.All(item => item.Email == credentials.Login));
// Clean up
DeleteTestDocument(document?.Id);
}
}
}