Exemplo n.º 1
0
        public void Send_SignatureRequest_Files_Response_Test()
        {
            var requestData = new HSSendSignatureRequestData
            {
                Title = "NDA for Project X",
                Subject = "NDA We Talk about",
                Message = "Bla Bla Bla",
                Signers = new List<HSSigner> {new HSSigner {Name = "John", EmailAddress = "*****@*****.**"}},
                Files = new List<FileInfo> {new FileInfo("TestData\\pdf-sample.pdf")}
            };

            using (var httpClient = FakeClientWithJsonResponse("TestData\\SignatureRequest.json"))
            {
                var apiClient = new HelloSignClient(httpClient);
                var t = apiClient.SendSignatureRequest(requestData);
                t.Wait();
                Assert.Equal("a9f4825edef25f47e7b", t.Result.SignatureRequest.SignatureRequestId);
            }
        }
Exemplo n.º 2
0
        public void Send_SignatureRequest_FileUrls_Response_Test()
        {
            var requestData = new HSSendSignatureRequestData
            {
                Title = "NDA for Project X",
                Subject = "NDA We Talk about",
                Message = "Bla Bla Bla",
                Signers = new List<HSSigner> { new HSSigner { Name = "John", EmailAddress = "*****@*****.**", Order = "1", Pin = "1234" } },
                FileUrls = new List<string> { "http://www.hollywood-arts.org/wp-content/uploads/2014/05/pdf-sample.pdf" },
            };

            using (var httpClient = FakeClientWithJsonResponse("TestData\\SignatureRequest.json"))
            {
                var apiClient = new HelloSignClient(httpClient);
                var t = apiClient.SendSignatureRequest(requestData);

                Assert.Equal("a9f4825edef25f47e7b", t.Result.SignatureRequest.SignatureRequestId);
            }
        }
Exemplo n.º 3
0
        public void Send_Invalid_SignatureRequest_Get_Exception()
        {
            var requestData = new HSSendSignatureRequestData
            {
                Title = "NDA for Project X",
                Subject = "NDA We Talk about",
                Message = "Bla Bla Bla",
                Files = new List<FileInfo> {new FileInfo("TestData\\pdf-sample.pdf")}
            };

            using (var httpClient = FakeClientWithJsonResponse("TestData\\SignatureRequest.json"))
            {
                var apiClient = new HelloSignClient(httpClient);

                Assert.Throws<ArgumentException>(() => {
                    apiClient.SendSignatureRequest(requestData);
                });
            }
        }