Пример #1
0
        public void CanAddTwoAttachmentRequirement()
        {
            Silanis.ESL.SDK.AttachmentRequirement attachmentRequirement1 = AttachmentRequirementBuilder.NewAttachmentRequirementWithName("Driver's license")
                                                                           .WithDescription("Please upload scanned driver's license.")
                                                                           .IsRequiredAttachment()
                                                                           .Build();
            Silanis.ESL.SDK.AttachmentRequirement attachmentRequirement2 = AttachmentRequirementBuilder.NewAttachmentRequirementWithName("Medicare card")
                                                                           .WithDescription("Please upload scanned medicare card.")
                                                                           .IsRequiredAttachment()
                                                                           .Build();

            Silanis.ESL.SDK.Signer signer = SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                            .WithFirstName("Billy")
                                            .WithLastName("Bob")
                                            .WithAttachmentRequirement(attachmentRequirement1)
                                            .WithAttachmentRequirement(attachmentRequirement2)
                                            .Build();

            Assert.AreEqual(signer.Attachments.Count, 2);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Name, attachmentRequirement1.Name);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Description, attachmentRequirement1.Description);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Required, attachmentRequirement1.Required);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Status, attachmentRequirement1.Status);
            Assert.AreEqual(signer.GetAttachmentRequirement("Medicare card").Name, attachmentRequirement2.Name);
            Assert.AreEqual(signer.GetAttachmentRequirement("Medicare card").Description, attachmentRequirement2.Description);
            Assert.AreEqual(signer.GetAttachmentRequirement("Medicare card").Required, attachmentRequirement2.Required);
            Assert.AreEqual(signer.GetAttachmentRequirement("Medicare card").Status.ToString(), attachmentRequirement2.Status.ToString());
        }
Пример #2
0
        public void ConvertAPIToSDK()
        {
            apiRole    = CreateTypicalAPIRole();
            apiSigner1 = apiRole.Signers[0];

            sdkSigner1 = new SignerConverter(apiRole).ToSDKSigner();

            Assert.IsNotNull(sdkSigner1);
            Assert.AreEqual(apiSigner1.Email, sdkSigner1.Email);
            Assert.AreEqual(apiSigner1.FirstName, sdkSigner1.FirstName);
            Assert.AreEqual(apiSigner1.LastName, sdkSigner1.LastName);
            Assert.AreEqual(apiSigner1.Company, sdkSigner1.Company);
            Assert.AreEqual(apiSigner1.Title, sdkSigner1.Title);
            Assert.AreEqual(apiRole.Id, sdkSigner1.Id);
            Assert.AreEqual(apiRole.Index, sdkSigner1.SigningOrder);
            Assert.AreEqual(apiRole.Reassign, sdkSigner1.CanChangeSigner);
            Assert.AreEqual(apiRole.EmailMessage.Content, sdkSigner1.Message);
            Assert.AreEqual(apiSigner1.Delivery.Email, sdkSigner1.DeliverSignedDocumentsByEmail);

            string attachmentName = apiRole.AttachmentRequirements[0].Name;

            Silanis.ESL.API.AttachmentRequirement apiAttachment = apiRole.AttachmentRequirements[0];
            Silanis.ESL.SDK.AttachmentRequirement sdkAttachment = sdkSigner1.GetAttachmentRequirement(attachmentName);
            Assert.AreEqual(attachmentName, sdkSigner1.GetAttachmentRequirement(attachmentName).Name);
            Assert.AreEqual(apiAttachment.Description, sdkAttachment.Description);
            Assert.AreEqual(apiAttachment.Required, sdkAttachment.Required);
            Assert.AreEqual(apiAttachment.Status.ToString(), sdkAttachment.Status.ToString());
            Assert.AreEqual(apiAttachment.Comment, sdkAttachment.SenderComment);
        }
        public void ConvertSDKToAPIWhenSdkAttachmentRequirementIsNull()
        {
            sdkAttachmentRequirement1    = CreateTypicalSDKAttachmentRequirement();
            sdkAttachmentRequirement1.Id = null;
            apiAttachmentRequirement1    = new AttachmentRequirementConverter(sdkAttachmentRequirement1).ToAPIAttachmentRequirement();

            Assert.IsNull(apiAttachmentRequirement1.Id);
        }
		public void ConvertSDKToSDK()
		{
			sdkAttachmentRequirement1 = CreateTypicalSDKAttachmentRequirement();
			sdkAttachmentRequirement2 = new AttachmentRequirementConverter(sdkAttachmentRequirement1).ToSDKAttachmentRequirement();

			Assert.IsNotNull(sdkAttachmentRequirement2);
			Assert.AreEqual(sdkAttachmentRequirement2, sdkAttachmentRequirement1);
		}
        public void ConvertSDKToSDK()
        {
            sdkAttachmentRequirement1 = CreateTypicalSDKAttachmentRequirement();
            sdkAttachmentRequirement2 = new AttachmentRequirementConverter(sdkAttachmentRequirement1).ToSDKAttachmentRequirement();

            Assert.IsNotNull(sdkAttachmentRequirement2);
            Assert.AreEqual(sdkAttachmentRequirement2, sdkAttachmentRequirement1);
        }
        private Silanis.ESL.SDK.AttachmentRequirement CreateTypicalSDKAttachmentRequirement()
        {
            Silanis.ESL.SDK.AttachmentRequirement attachmentRequirement = AttachmentRequirementBuilder.NewAttachmentRequirementWithName("Driver's license")
                                                                          .WithDescription("Please upload a scanned copy of your driver's license")
                                                                          .IsRequiredAttachment()
                                                                          .Build();
            attachmentRequirement.Id = "attachmentId";

            return(attachmentRequirement);
        }
		public AttachmentRequirement Build()
		{
			Asserts.NotEmptyOrNull(name, "name");
			AttachmentRequirement attachmentRequirement = new AttachmentRequirement(name);
			attachmentRequirement.Description = desciption;
			attachmentRequirement.Required = isRequired;
			attachmentRequirement.Status = Silanis.ESL.SDK.RequirementStatus.INCOMPLETE;

			return attachmentRequirement;
		}
        public AttachmentRequirement Build()
        {
            Asserts.NotEmptyOrNull(name, "name");
            AttachmentRequirement attachmentRequirement = new AttachmentRequirement(name);

            attachmentRequirement.Description = desciption;
            attachmentRequirement.Required    = isRequired;
            attachmentRequirement.Status      = Silanis.ESL.SDK.RequirementStatus.INCOMPLETE;

            return(attachmentRequirement);
        }
        public void ConvertSDKToAPI()
        {
            sdkAttachmentRequirement1 = CreateTypicalSDKAttachmentRequirement();
            apiAttachmentRequirement1 = new AttachmentRequirementConverter(sdkAttachmentRequirement1).ToAPIAttachmentRequirement();

            Assert.AreEqual(apiAttachmentRequirement1.Name, sdkAttachmentRequirement1.Name);
            Assert.AreEqual(apiAttachmentRequirement1.Description, sdkAttachmentRequirement1.Description);
            Assert.AreEqual(apiAttachmentRequirement1.Id, sdkAttachmentRequirement1.Id);
            Assert.AreEqual(apiAttachmentRequirement1.Required, sdkAttachmentRequirement1.Required);
            Assert.AreEqual(apiAttachmentRequirement1.Status, sdkAttachmentRequirement1.Status.ToString());
            Assert.AreEqual(apiAttachmentRequirement1.Comment, sdkAttachmentRequirement1.SenderComment);
        }
        public void ConvertAPIToSDK()
        {
            apiAttachmentRequirement1 = CreateTypicalAPIAttachmentRequirement();
            sdkAttachmentRequirement1 = new AttachmentRequirementConverter(apiAttachmentRequirement1).ToSDKAttachmentRequirement();

            Assert.AreEqual(sdkAttachmentRequirement1.Name, apiAttachmentRequirement1.Name);
            Assert.AreEqual(sdkAttachmentRequirement1.Description, apiAttachmentRequirement1.Description);
            Assert.AreEqual(sdkAttachmentRequirement1.Id, apiAttachmentRequirement1.Id);
            Assert.AreEqual(sdkAttachmentRequirement1.Required, apiAttachmentRequirement1.Required);
            Assert.AreEqual(sdkAttachmentRequirement1.Status.getApiValue(), apiAttachmentRequirement1.Status);
            Assert.AreEqual(sdkAttachmentRequirement1.SenderComment, apiAttachmentRequirement1.Comment);
        }
		public void ConvertSDKToAPI()
		{
			sdkAttachmentRequirement1 = CreateTypicalSDKAttachmentRequirement();
			apiAttachmentRequirement1 = new AttachmentRequirementConverter(sdkAttachmentRequirement1).ToAPIAttachmentRequirement();

			Assert.AreEqual(apiAttachmentRequirement1.Name, sdkAttachmentRequirement1.Name);
			Assert.AreEqual(apiAttachmentRequirement1.Description, sdkAttachmentRequirement1.Description);
			Assert.AreEqual(apiAttachmentRequirement1.Id, sdkAttachmentRequirement1.Id);
			Assert.AreEqual(apiAttachmentRequirement1.Required, sdkAttachmentRequirement1.Required);
			Assert.AreEqual(apiAttachmentRequirement1.Status.ToString(), sdkAttachmentRequirement1.Status.ToString());
			Assert.AreEqual(apiAttachmentRequirement1.Comment, sdkAttachmentRequirement1.SenderComment);
		}
		public void ConvertAPIToSDK()
		{
			apiAttachmentRequirement1 = CreateTypicalAPIAttachmentRequirement();
			sdkAttachmentRequirement1 = new AttachmentRequirementConverter(apiAttachmentRequirement1).ToSDKAttachmentRequirement();

			Assert.AreEqual(sdkAttachmentRequirement1.Name, apiAttachmentRequirement1.Name);
			Assert.AreEqual(sdkAttachmentRequirement1.Description, apiAttachmentRequirement1.Description);
			Assert.AreEqual(sdkAttachmentRequirement1.Id, apiAttachmentRequirement1.Id);
			Assert.AreEqual(sdkAttachmentRequirement1.Required, apiAttachmentRequirement1.Required);
			Assert.AreEqual(sdkAttachmentRequirement1.Status.ToString(), apiAttachmentRequirement1.Status.ToString());
			Assert.AreEqual(sdkAttachmentRequirement1.SenderComment, apiAttachmentRequirement1.Comment);
		}
Пример #13
0
        public void CanSetAndGetAttachmentRequirements()
        {
            Silanis.ESL.SDK.AttachmentRequirement attachmentRequirement = AttachmentRequirementBuilder.NewAttachmentRequirementWithName("Driver's license")
                                                                          .WithDescription("Please upload scanned driver's license.")
                                                                          .IsRequiredAttachment()
                                                                          .Build();

            Silanis.ESL.SDK.Signer signer = SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                            .WithFirstName("Billy")
                                            .WithLastName("Bob")
                                            .WithAttachmentRequirement(attachmentRequirement)
                                            .Build();

            Assert.AreEqual(signer.Attachments.Count, 1);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Name, attachmentRequirement.Name);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Description, attachmentRequirement.Description);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Required, attachmentRequirement.Required);
            Assert.AreEqual(signer.GetAttachmentRequirement("Driver's license").Status, attachmentRequirement.Status);
        }
 public void ConvertNullSDKToSDK()
 {
     sdkAttachmentRequirement1 = null;
     converter = new AttachmentRequirementConverter(sdkAttachmentRequirement1);
     Assert.IsNull(converter.ToSDKAttachmentRequirement());
 }
		public void ConvertNullSDKToSDK()
		{
			sdkAttachmentRequirement1 = null;
			converter = new AttachmentRequirementConverter(sdkAttachmentRequirement1);
			Assert.IsNull(converter.ToSDKAttachmentRequirement());
		}