-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathGetFolder.cs
More file actions
39 lines (34 loc) · 1.42 KB
/
GetFolder.cs
File metadata and controls
39 lines (34 loc) · 1.42 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
34
35
36
37
38
39
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SignNow.Net.Model;
using SignNow.Net.Model.Requests;
using SignNow.Net.Model.Requests.GetFolderQuery;
namespace SignNow.Net.Examples
{
public partial class FolderExamples
{
[TestMethod]
public async Task GetFolderAsync()
{
// Get all folders
var folders = await testContext.Folders.GetAllFoldersAsync().ConfigureAwait(false);
// Get folderId of the "Documents" folder
var folderId = folders.Folders.FirstOrDefault(f => f.Name == "Documents")?.Id;
var filterBySigningStatus = new GetFolderOptions
{
Filters = new FolderFilters(SigningStatus.Pending)
};
// Get all details of a specific folder including a list of all documents in that folder
var folder = await testContext.Folders
.GetFolderAsync(folderId, filterBySigningStatus)
.ConfigureAwait(false);
// Check if folder contains only pending documents
Assert.IsTrue(folders.Documents.All(d => d.Status == DocumentStatus.Pending));
Assert.AreEqual(folders.TotalDocuments, folders.Documents.Count);
Assert.IsTrue(folder.SystemFolder);
Assert.AreEqual(folderId, folder.Id);
Assert.AreEqual(folders.Id, folder.ParentId);
}
}
}