public void FixtureSetup()
 {
     DocuSignWeb.Recipient[] recipients = SendingTests.CreateOneSigner();
     _envelope = Envelope.CreateAndSendEnvelope(SendingTests.DefaultCredentials, recipients, SendingTests.LoadPicturePdf(recipients[0]),
                                                "SendForSignature unit test", "testing docusign signing services");
     Assert.IsNotNull(_envelope);
 }
        public void RequestTokenRequestRecipientTokenFromTemplate()
        {
            _recipients = SendingTests.CreateOneSigner();
            _recipients[0].CaptiveInfo = new DocuSignWeb.RecipientCaptiveInfo();
            _recipients[0].CaptiveInfo.ClientUserId = _captiveInfoClientId;

            //
            // generate role assignments
            LinkedTemplateReferenceRoleAssignment[] roleAssignments = new LinkedTemplateReferenceRoleAssignment[]
            { new LinkedTemplateReferenceRoleAssignment(_recipients[0], "Signer1") };

            DocuSignWeb.CustomField[] fields = new DocuSignWeb.CustomField[1];
            fields[0]          = new DocuSignWeb.CustomField();
            fields[0].Name     = "Customer ID";
            fields[0].Required = "False";
            fields[0].Show     = "False";
            fields[0].Value    = "1234-1234-1234";

            _envelope = Envelope.CreateEnvelopeFromTemplates(SendingTests.DefaultCredentials,
                                                             _recipients,
                                                             roleAssignments,
                                                             Resource.sampleTemplate,
                                                             "SendForSignature template unit test", "testing template creation with embedded signing",
                                                             fields);
            Assert.IsNotNull(_envelope);

            string token = _envelope.RequestRecipientToken(
                _recipients[0],
                CreateAssertion(),
                Envelope.StandardUrls(new System.Uri("https://somebase.dsx.test/callback.aspx", UriKind.Absolute),
                                      "Mike B"));

            Assert.IsNotEmpty(token);
            Console.Out.WriteLine("The token is: " + token);
        }
        public void FixtureSetup()
        {
            _recipients = SendingTests.CreateOneSigner();
            _recipients[0].CaptiveInfo = new DocuSignWeb.RecipientCaptiveInfo();
            _recipients[0].CaptiveInfo.ClientUserId = _captiveInfoClientId;

            _envelope = Envelope.CreateAndSendEnvelope(SendingTests.DefaultCredentials, _recipients, SendingTests.LoadPicturePdf(_recipients[0]),
                                                       "SendForSignature unit test", "testing docusign signing services");
            Assert.IsNotNull(_envelope);
        }
Exemplo n.º 4
0
        public void TestAnchorTab()
        {
            int    XOffset = 200;
            int    YOffset = 300;
            string anchor  = "Sign here:";

            LinkedTab tab = LinkedTab.CreateTab(DocuSignWeb.TabTypeCode.InitialHere,
                                                SendingTests.CreateOneSigner()[0], anchor, XOffset, YOffset);

            Assert.IsNotNull(tab);
            Assert.AreEqual((double)XOffset, tab.Tab.AnchorTabItem.XOffset);
            Assert.AreEqual((double)YOffset, tab.Tab.AnchorTabItem.YOffset);
            Assert.AreEqual(DocuSignWeb.TabTypeCode.InitialHere, tab.Tab.Type);
        }
Exemplo n.º 5
0
        public void TestInitialTab()
        {
            int pageNumber = 1;
            int XPosition  = 200;
            int YPosition  = 300;

            LinkedTab tab = LinkedTab.CreateTab(DocuSignWeb.TabTypeCode.InitialHere,
                                                SendingTests.CreateOneSigner()[0],
                                                pageNumber, XPosition, YPosition);

            Assert.IsNotNull(tab);
            Assert.AreEqual(pageNumber.ToString(CultureInfo.InvariantCulture), tab.Tab.PageNumber);
            Assert.AreEqual(XPosition.ToString(CultureInfo.InvariantCulture), tab.Tab.XPosition);
            Assert.AreEqual(YPosition.ToString(CultureInfo.InvariantCulture), tab.Tab.YPosition);
            Assert.AreEqual(DocuSignWeb.TabTypeCode.InitialHere, tab.Tab.Type);
        }
        public void Field()
        {
            DocuSignWeb.Recipient[]   recipients = SendingTests.CreateOneSigner();
            DocuSignWeb.CustomField[] fields     = new DocuSignWeb.CustomField[1];
            fields[0]          = new DocuSignWeb.CustomField();
            fields[0].Name     = "Form ID";
            fields[0].Required = "False";
            fields[0].Show     = "False";
            fields[0].Value    = "1234";

            _envelope = Envelope.CreateAndSendEnvelope(SendingTests.DefaultCredentials, recipients, SendingTests.LoadPicturePdf(recipients[0]),
                                                       "SendForSignature unit test", "testing docusign signing services", fields);
            Assert.IsNotNull(_envelope);

            DocuSignWeb.EnvelopeStatus status = _envelope.RetrieveFullStatus();
            Assert.IsNotNull(status);
            Assert.AreEqual("1234", status.CustomFields[0].Value);
        }
Exemplo n.º 7
0
        public void TestCustomTab()
        {
            string name       = "AddressLine1";
            string value      = "1234 Victoria Lane";
            int    pageNumber = 1;
            int    XPosition  = 200;
            int    YPosition  = 300;

            LinkedTab tab = LinkedTab.CreateTab(SendingTests.CreateOneSigner()[0],
                                                name, value, pageNumber, XPosition, YPosition);

            Assert.IsNotNull(tab);
            Assert.AreEqual(name, tab.Tab.Name);
            Assert.AreEqual(value, tab.Tab.Value);
            Assert.AreEqual(pageNumber.ToString(CultureInfo.InvariantCulture), tab.Tab.PageNumber);
            Assert.AreEqual(XPosition.ToString(CultureInfo.InvariantCulture), tab.Tab.XPosition);
            Assert.AreEqual(YPosition.ToString(CultureInfo.InvariantCulture), tab.Tab.YPosition);
            Assert.AreEqual(DocuSignWeb.TabTypeCode.Custom, tab.Tab.Type);
        }
Exemplo n.º 8
0
        public void TestCustomAnchorTab()
        {
            int    XOffset = 200;
            int    YOffset = 300;
            string anchor  = "Address:";
            string name    = "AddressLine1";
            string value   = "1234 Victoria Lane";

            LinkedTab tab = LinkedTab.CreateTab(
                SendingTests.CreateOneSigner()[0],
                name, value, anchor, XOffset, YOffset);

            Assert.IsNotNull(tab);
            Assert.AreEqual(name, tab.Tab.Name);
            Assert.AreEqual(value, tab.Tab.Value);
            Assert.AreEqual((double)XOffset, tab.Tab.AnchorTabItem.XOffset);
            Assert.AreEqual((double)YOffset, tab.Tab.AnchorTabItem.YOffset);
            Assert.AreEqual(DocuSignWeb.TabTypeCode.Custom, tab.Tab.Type);
        }
        public void RequestTokenRequestRecipientToken()
        {
            _recipients = SendingTests.CreateOneSigner();
            _recipients[0].CaptiveInfo = new DocuSignWeb.RecipientCaptiveInfo();
            _recipients[0].CaptiveInfo.ClientUserId = _captiveInfoClientId;

            _envelope = Envelope.CreateAndSendEnvelope(SendingTests.DefaultCredentials, _recipients, SendingTests.LoadPicturePdf(_recipients[0]),
                                                       "SendForSignature unit test", "testing docusign signing services");
            Assert.IsNotNull(_envelope);

            string token = _envelope.RequestRecipientToken(
                _recipients[0],
                CreateAssertion(),
                Envelope.StandardUrls(new System.Uri("https://somebase.dsx.test/callback.aspx", UriKind.Absolute),
                                      "Mike B"));

            Assert.IsNotEmpty(token);
            Console.Out.WriteLine("The token is: " + token);
        }
        public void Attachment()
        {
            System.Text.ASCIIEncoding enc        = new System.Text.ASCIIEncoding();
            DocuSignWeb.Recipient[]   recipients = SendingTests.CreateOneSigner();
            DocuSignWeb.Attachment    attachment = new DocuSignWeb.Attachment();
            attachment.Label = "Label1";
            attachment.Data  = enc.GetBytes("Data");
            attachment.Type  = "String";

            _envelope = Envelope.CreateAndSendEnvelope(SendingTests.DefaultCredentials, recipients, SendingTests.LoadPicturePdf(recipients[0]),
                                                       "SendForSignature unit test", "testing docusign signing services", null, new DocuSignWeb.Attachment[] { attachment });
            Assert.IsNotNull(_envelope);

            DocuSignWeb.EnvelopeStatus status = _envelope.RetrieveFullStatus();

            Assert.IsNotNull(status);
            Assert.IsNotNull(status.EnvelopeAttachment);
            Assert.IsTrue(status.EnvelopeAttachment.Length > 0);
            Assert.IsNotNull(status.EnvelopeAttachment[0].Data);
            Assert.AreEqual(enc.GetString(status.EnvelopeAttachment[0].Data), "Data");
        }