public void EnvelopeCreateNoDocument() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = true; Account acct = new Account(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); acct.Password = "******"; try { actual = acct.Create(); } catch (Exception) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(acct.BaseUrl)); Envelope target = new Envelope(); target.Login = acct; actual = false; try { actual = target.Create(string.Empty); } catch (ArgumentNullException) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(target.SenderViewUrl)); }
public void EnvelopeCreateWithDocumentTest() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; Account acct = new Account(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); acct.Password = "******"; AddressInformation ai = new AddressInformation(); acct.Address = ai; ai.address1 = "123 Main ST"; ai.address2 = string.Empty; ai.city = "Anytown"; ai.country = "USA"; ai.postalCode = "11111"; ai.state = "WA"; CreditCardInformation cc = new CreditCardInformation(); acct.CreditCard = cc; cc.cardNumber = "4111111111111111"; cc.cardType = "visa"; cc.expirationMonth = "12"; cc.expirationYear = "2015"; cc.nameOnCard = "Freak Me Out"; try { actual = acct.Create(); } catch (Exception) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(acct.BaseUrl)); Envelope target = new Envelope(); target.Login = acct; FileInfo fi = new FileInfo("./Test Contract.pdf"); string path = fi.FullName; actual = false; try { actual = target.Create(path); } catch (ArgumentNullException) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(target.SenderViewUrl)); }
public void EnvelopeCreateWithSmsAuthenticationDocumentTest() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; Account acct = new Account(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); acct.Password = "******"; AddressInformation ai = new AddressInformation(); acct.Address = ai; ai.address1 = "123 Main ST"; ai.address2 = string.Empty; ai.city = "Anytown"; ai.country = "USA"; ai.postalCode = "11111"; ai.state = "WA"; CreditCardInformation cc = new CreditCardInformation(); acct.CreditCard = cc; cc.cardNumber = "4111111111111111"; cc.cardType = "visa"; cc.expirationMonth = "12"; cc.expirationYear = "2015"; cc.nameOnCard = "Freak Me Out"; try { actual = acct.Create(); } catch (Exception) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(acct.BaseUrl)); if (expected == actual) { Envelope target = new Envelope(); target.Login = acct; // add signers to the envelope target.Recipients = new Recipients() { signers = new Signer[] { new Signer() { email = "freakin_{unique}@gmail.com", name = "freakin", routingOrder = "1", recipientId = "1", requireIdLookup = "true", idCheckConfigurationName = "SMS Auth $", smsAuthentication = new SmsAuthentication() { senderProvidedNumbers = new string[] { String.Format("+{0} {1}", "34", "000000000") } } } } }; // Email subject is a required parameter when requesting signatures target.EmailSubject = "Example subject"; // "sent" to send immediately, "created" to save envelope as draft target.Status = "sent"; FileInfo fi = new FileInfo("./Test Contract.pdf"); string path = fi.FullName; actual = false; try { actual = target.Create(path); } catch (ArgumentNullException) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(target.SenderViewUrl)); } }
public void AccountCreate() { try { bool expected = true; bool actual = false; ConfigLoader.LoadConfig(); Account acct = new Account(); //acct.Email = "*****@*****.**"; //acct.Password = "******"; //acct.AccountName = "Fester Rester"; acct.Password = Guid.NewGuid().ToString(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); //AddressInformation ai = new AddressInformation(); //acct.Address = ai; //ai.address1 = "123 Main ST"; //ai.address2 = string.Empty; //ai.city = "Anytown"; //ai.country = "USA"; //ai.postalCode = "11111"; //ai.state = "WA"; //CreditCardInformation cc = new CreditCardInformation(); //acct.CreditCard = cc; //cc.cardNumber = "4111 1111 1111 1111"; //cc.cardType = "visa"; //cc.expirationMonth = "12"; //cc.expirationYear = "2015"; //cc.nameOnCard = "Freak Me Out"; try { actual = acct.Create(); } catch (Exception) { } Assert.AreEqual(expected, actual); } catch (Exception) { Assert.IsTrue(true); } }
public void EnvelopeCreateAddMemberWithDocumentTest() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; Account acct = new Account(); acct.AccountName = Util.MakeUnique("ds client unit test {unique}"); acct.Email = Util.MakeUnique("ds_client_unit_{unique}@gmail.com"); acct.Password = "******"; try { actual = acct.Create(); } catch (Exception) { } Assert.AreEqual(expected, actual); AddUsers add = new AddUsers(); List<NewUser> userList = new List<NewUser>(); NewUser nu = new NewUser(); nu.userName = Util.MakeUnique("ds client unit test member {unique}"); nu.email = Util.MakeUnique("ds_client_unit_member_{unique}@gmail.com"); nu.sendActivationOnInvalidLogin = false.ToString(); nu.enableConnectForUser = true.ToString(); Guid g = Guid.NewGuid(); nu.password = g.ToString(); List<UserSetting> userSettings = new List<UserSetting>(); userSettings.Add(new UserSetting("canSendAPIRequests", "true")); userSettings.Add(new UserSetting("canSendEnvelope", "true")); userSettings.Add(new UserSetting("AllowSendOnBehalfOf", "true")); nu.userSettings = userSettings.ToArray(); userList.Add(nu); add.newUsers = userList.ToArray(); CreatedUsers added = null; try { added = acct.AddUser(add); } catch (Exception) { } Account member = new Account(); member.ApiPassword = added.NewUsers[0].ApiPassword; member.AccountId = added.NewUsers[0].UserId; member.Email = added.NewUsers[0].Email; //member.BaseUrl = added.NewUsers[0].Uri; bool log = member.Login(); Assert.IsNotNull(added); Envelope target = new Envelope(); target.Login = member; FileInfo fi = new FileInfo("./Test Contract.pdf"); string path = fi.FullName; actual = false; try { actual = target.Create(path); } catch (ArgumentNullException) { } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(target.SenderViewUrl)); }
public void AccountCreateAddUser() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; Account acct = new Account(); acct.AccountName = Util.MakeUnique("ds client unit test {unique}"); acct.Email = Util.MakeUnique("ds_client_unit_{unique}@gmail.com"); acct.Password = "******"; try { actual = acct.Create(); } catch (Exception) { } Assert.AreEqual(expected, actual); AddUsers add = new AddUsers(); List<NewUser> userList = new List<NewUser>(); NewUser nu = new NewUser(); nu.userName = Util.MakeUnique("ds client unit test member {unique}"); nu.email = Util.MakeUnique("ds_client_unit_member_{unique}@gmail.com"); nu.sendActivationOnInvalidLogin = false.ToString(); nu.enableConnectForUser = true.ToString(); Guid g = Guid.NewGuid(); nu.password = g.ToString(); List<UserSetting> userSettings = new List<UserSetting>(); userSettings.Add(new UserSetting("canSendAPIRequests", "true")); userSettings.Add(new UserSetting("canSendEnvelope", "true")); userSettings.Add(new UserSetting("AllowSendOnBehalfOf", "true")); nu.userSettings = userSettings.ToArray(); userList.Add(nu); add.newUsers = userList.ToArray(); CreatedUsers added = null; try { added = acct.AddUser(add); } catch (Exception) { } Assert.IsNotNull(added); }
public void AccountLogin() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; // create a new account Account acct = new Account(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); acct.Password = "******"; try { actual = acct.Create(); } catch (Exception) { actual = false; } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(acct.BaseUrl)); Assert.IsFalse(string.IsNullOrEmpty(acct.ApiPassword)); actual = false; Account acct2 = new Account(); acct2.AccountName = acct.AccountName; acct2.Email = acct.Email; acct2.Password = acct.Password; try { actual = acct2.Login(); } catch (Exception) { actual = false; } Assert.AreEqual(expected, actual); Assert.IsFalse(string.IsNullOrEmpty(acct.BaseUrl)); Assert.IsFalse(string.IsNullOrEmpty(acct.ApiPassword)); }
public void AccountCreateSocialNoUserName() { ConfigLoader.LoadConfig(); bool expected = false; bool actual = true; Account acct = new Account(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); acct.Password = "******"; acct.Social = new SocialAccountInformation(); acct.Social.email = acct.Email; acct.Social.provider = "FaceBook"; acct.Social.socialId = string.Empty; acct.Social.userName = string.Empty; try { actual = acct.Create(); } catch(Exception) { actual = false; } Assert.AreEqual(expected, actual); }
public void AccountCreateSocial() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; Account acct = new Account(); acct.AccountName = Util.MakeUnique("restclienttest {unique}"); acct.Email = Util.MakeUnique("restclienttest_{unique}@gmail.com"); //acct.AccountName = "Trinity UltraStar"; //acct.Email = "*****@*****.**"; acct.Password = Guid.NewGuid().ToString(); acct.Social = new SocialAccountInformation(); acct.Social.email = acct.Email; acct.Social.provider = "Google"; acct.Social.socialId = Util.MakeUnique("{unique}"); acct.Social.userName = acct.AccountName; try { actual = acct.Create(); var trace = acct.RestTrace; Assert.AreEqual(expected, actual); if (actual == true) { actual = false; acct.Password = string.Empty; acct.Email = acct.AccountIdGuid.ToString(); actual = acct.Login(); trace = acct.RestTrace; Assert.AreEqual(expected, actual); } } catch (Exception) { actual = false; } Assert.AreEqual(expected, actual); }
public void AccountCreateNoPassword() { ConfigLoader.LoadConfig(); bool expected = true; bool actual = false; Account acct = new Account(); acct.AccountName = Util.MakeUnique("freakin me out {unique}"); acct.Email = Util.MakeUnique("freakin_{unique}@gmail.com"); acct.Password = string.Empty; try { actual = acct.Create(); } catch(Exception) { actual = false; } Assert.AreEqual(expected, actual); }