FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SignNow.NET/SignNow.Net.Examples/Folders/CreateFolder.cs at develop · Yagg/SignNow.NET · GitHub
Yagg
/
SignNow.NET
Public
forked from
signnow/SignNow.NET
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SignNow.NET
/
SignNow.Net.Examples
/
Folders
/
CreateFolder.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (34 loc) · 1.55 KB
Breadcrumbs
SignNow.NET
/
SignNow.Net.Examples
/
Folders
/
CreateFolder.cs
Copy path
File metadata and controls
41 lines (34 loc) · 1.55 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
40
41
using
System
;
using
System
.
Linq
;
using
System
.
Threading
.
Tasks
;
using
Microsoft
.
VisualStudio
.
TestTools
.
UnitTesting
;
using
SignNow
.
Net
.
Model
.
Requests
;
namespace
SignNow
.
Net
.
Examples
{
public
partial
class
FolderExamples
:
ExamplesBase
{
[
TestMethod
]
public
async
Task
CreateFolderAsync
(
)
{
// Get Root folder and Documents folder
var
root
=
await
testContext
.
Folders
.
GetAllFoldersAsync
(
)
.
ConfigureAwait
(
false
)
;
var
documentsFolder
=
root
.
Folders
.
FirstOrDefault
(
f
=>
f
.
Name
==
"Documents"
)
;
var
timestamp
=
(
long
)
(
DateTime
.
Now
-
UnixEpoch
)
.
TotalSeconds
;
// Note: You should use different folder name for each example run
var
myFolderName
=
$
"CreateFolderExample_
{
timestamp
}
"
;
// Creating new folder
var
createNewFolder
=
await
testContext
.
Folders
.
CreateFolderAsync
(
myFolderName
,
documentsFolder
?
.
Id
)
.
ConfigureAwait
(
false
)
;
Assert
.
IsNotNull
(
createNewFolder
.
Id
)
;
// Check if new folder exists
var
checkNewFolderExists
=
await
testContext
.
Folders
.
GetFolderAsync
(
documentsFolder
?
.
Id
,
new
GetFolderOptions
{
IncludeDocumentsSubfolder
=
false
}
)
.
ConfigureAwait
(
false
)
;
var
myFolder
=
checkNewFolderExists
.
Folders
.
FirstOrDefault
(
f
=>
f
.
Name
==
myFolderName
)
;
Assert
.
AreEqual
(
myFolderName
,
myFolder
?
.
Name
)
;
// clean up
await
testContext
.
Folders
.
DeleteFolderAsync
(
myFolder
?
.
Id
)
.
ConfigureAwait
(
false
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL