예제 #1
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);
        }
        /// <summary>
        /// Sender rejects signer's attachment requirement with a comment.
        /// </summary>
        /// <param name="packageId">Package identifier.</param>
        /// <param name="signer">Signer.</param>
        /// <param name="attachmentId">Attachment identifier.</param>
        /// <param name="senderComment">Sender comment.</param>
        public void RejectAttachment(PackageId packageId, Signer signer, String attachmentName, String senderComment)
        {
            signer.GetAttachmentRequirement(attachmentName).SenderComment = senderComment;
            signer.GetAttachmentRequirement(attachmentName).Status        = RequirementStatus.REJECTED;

            packageService.UpdateSigner(packageId, signer);
        }
        /// <summary>
        /// Sender accepts signer's attachment requirement.
        /// </summary>
        /// <param name="packageId">Package identifier.</param>
        /// <param name="signer">Signer.</param>
        /// <param name="attachmentId">Attachment identifier.</param>
        public void AcceptAttachment(PackageId packageId, Signer signer, String attachmentName)
        {
            signer.GetAttachmentRequirement(attachmentName).SenderComment = "";
            signer.GetAttachmentRequirement(attachmentName).Status        = Silanis.ESL.SDK.RequirementStatus.COMPLETE;

            packageService.UpdateSigner(packageId, signer);
        }
예제 #4
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());
        }
예제 #5
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);
        }
예제 #6
0
        public void ConvertSDKSignerToAPIRole()
        {
            sdkSigner1 = CreateTypicalSDKSigner();
            String roleId = System.Guid.NewGuid().ToString().Replace("-", "");

            apiRole = new SignerConverter(sdkSigner1).ToAPIRole(roleId);

            Assert.IsNotNull(apiRole);
            Assert.AreEqual(apiRole.Signers[0].Email, sdkSigner1.Email);
            Assert.AreEqual(apiRole.Signers[0].FirstName, sdkSigner1.FirstName);
            Assert.AreEqual(apiRole.Signers[0].LastName, sdkSigner1.LastName);
            Assert.AreEqual(apiRole.Signers[0].Company, sdkSigner1.Company);
            Assert.AreEqual(apiRole.Signers[0].Title, sdkSigner1.Title);
            Assert.AreEqual(apiRole.Id, sdkSigner1.Id);
            Assert.AreEqual(apiRole.Name, sdkSigner1.Id);
            Assert.AreEqual(apiRole.EmailMessage.Content, sdkSigner1.Message);

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

            Assert.AreEqual(apiRole.AttachmentRequirements[0].Name, sdkSigner1.GetAttachmentRequirement(attachmentName).Name);
            Assert.AreEqual(apiRole.AttachmentRequirements[0].Description, sdkSigner1.GetAttachmentRequirement(attachmentName).Description);
            Assert.AreEqual(apiRole.AttachmentRequirements[0].Required, sdkSigner1.GetAttachmentRequirement(attachmentName).Required);
        }