Exemplo n.º 1
0
        public void Download_SignatureRequest_without_FileStorage_throw_Exception_Test()
        {
            using (var httpClient = FakeClientWithFileResponse("sample.pdf","TestData\\pdf-sample.pdf"))
            {
                var apiClient = new HelloSignClient(httpClient);
                var outputPath = new FileInfo("TestData\\sample.pdf");
                if (outputPath.Exists)
                    outputPath.Delete();

                Assert.Throws<IOException>(() =>
                {
                    var t = apiClient.DownloadSignatureRequestDocuments(new HSDownloadSignatureRequestData { SignatureRequestId = "DUMMY-SIGNATURE-ID", FileType = "pdf" }, outputPath.DirectoryName);
                    t.Wait();
                });
            }
        }
Exemplo n.º 2
0
        public void Download_SignatureRequest_Document_Response_Test()
        {
            using (var httpClient = FakeClientWithFileResponse("sample.pdf","TestData\\pdf-sample.pdf"))
            {
                var apiClient = new HelloSignClient(httpClient) {FileStorage = new WindowsFileStorage()};
                var outputPath = new FileInfo("TestData\\sample.pdf");
                if (outputPath.Exists)
                    outputPath.Delete();

                var t = apiClient.DownloadSignatureRequestDocuments(new HSDownloadSignatureRequestData { SignatureRequestId = "DUMMY-SIGNATURE-ID", FileType = "pdf" }, outputPath.DirectoryName);
                t.Wait();

                Assert.True(outputPath.Exists);
            }
        }