-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDownloadSignedDocument.cs
More file actions
32 lines (28 loc) · 1.06 KB
/
DownloadSignedDocument.cs
File metadata and controls
32 lines (28 loc) · 1.06 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
using System.IO;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SignNow.Net.Model;
namespace SignNow.Net.Examples
{
public partial class DocumentExamples
{
[TestMethod]
public async Task DownloadSignedDocumentAsync()
{
// Upload document
await using var fileStream = File.OpenRead(PdfWithoutFields);
var document = await testContext.Documents
.UploadDocumentAsync(fileStream, "SignedDocumentTest.pdf")
.ConfigureAwait(false);
// Download signed document
var documentSigned = await testContext.Documents
.DownloadDocumentAsync(document.Id, DownloadType.PdfCollapsed)
.ConfigureAwait(false);
// Check if document is downloaded
Assert.AreEqual("SignedDocumentTest.pdf", documentSigned.Filename);
Assert.IsInstanceOfType(documentSigned.Document, typeof(Stream));
// Clean up
DeleteTestDocument(document.Id);
}
}
}