-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCreateSignNowUser.cs
40 lines (35 loc) · 1.24 KB
/
CreateSignNowUser.cs
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
using System;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SignNow.Net.Model.Requests;
namespace SignNow.Net.Examples
{
[TestClass]
public partial class UserExamples : ExamplesBase
{
[TestMethod]
public async Task CreateSignNowUserAsync()
{
var timestamp = (long)(DateTime.Now - UnixEpoch).TotalSeconds;
var email = $"signnow.tutorial+create_user_test{timestamp}@gmail.com";
var userRequest = new CreateUserOptions
{
Email = email,
FirstName = "John",
LastName = "Wick",
Password = "password"
};
// Create a new user
var createUserResponse = await testContext.Users
.CreateUserAsync(userRequest)
.ConfigureAwait(false);
// Check if the user was created and not verified
Assert.AreEqual(email, createUserResponse.Email);
Assert.IsFalse(createUserResponse.Verified);
// Finally - send verification email to User
await testContext.Users
.SendVerificationEmailAsync(email)
.ConfigureAwait(false);
}
}
}