|
| 1 | +namespace Aspose.Cells.Cloud.SDK.Test |
| 2 | +{ |
| 3 | + using System.IO; |
| 4 | + using System.Collections.Generic; |
| 5 | + using NUnit.Framework; |
| 6 | + using Aspose.Cells.Cloud.SDK.Api; |
| 7 | + using Aspose.Cells.Cloud.SDK.Model; |
| 8 | + /// <summary> |
| 9 | + /// Class for testing CellsWorkbookApi |
| 10 | + /// </summary> |
| 11 | + /// <remarks> |
| 12 | + /// This file is automatically generated by Swagger Codegen. |
| 13 | + /// Please update the test case below to test the API endpoint. |
| 14 | + /// </remarks> |
| 15 | + [TestFixture] |
| 16 | + public class Freeing2204Tests : CellsBaseTest |
| 17 | + { |
| 18 | + private CellsApi instance; |
| 19 | + /// <summary> |
| 20 | + /// Setup before each unit test |
| 21 | + /// </summary> |
| 22 | + [SetUp] |
| 23 | + public void Init() |
| 24 | + { |
| 25 | + instance = new CellsApi(clientId, clientSecret, apiVersion, testbaseurl); |
| 26 | + } |
| 27 | + |
| 28 | + /// <summary> |
| 29 | + /// Clean up after each unit test |
| 30 | + /// </summary> |
| 31 | + [TearDown] |
| 32 | + public void Cleanup() |
| 33 | + { |
| 34 | + |
| 35 | + } |
| 36 | + [Test] |
| 37 | + public void CellsCELLSCLOUD_Extand_GetWorkbook_Test() |
| 38 | + { |
| 39 | + UpdateDataFile(instance, TEMPFOLDER, BOOK1); |
| 40 | + var response = instance.CellsWorkbookGetWorkbook(BOOK1, null, "pdf", null, null, TEMPFOLDER, null, "Freeing/CellsCELLSCLOUD_Extand_GetWorkbook_Test.pdf", null, new Dictionary<string, string> { { "OnePagePerSheet", "false" } }); |
| 41 | + Assert.IsInstanceOf<Stream>(response, "response is System.IO.Stream"); |
| 42 | + } |
| 43 | + |
| 44 | + [Test] |
| 45 | + public void CellsCELLSCLOUD_Extand_Saveas_Test() |
| 46 | + { |
| 47 | + UpdateDataFile(instance, TEMPFOLDER, BOOK1); |
| 48 | + var response = instance.CellsSaveAsPostDocumentSaveAs(BOOK1, null, "Freeing/CellsCELLSCLOUD_Extand_Saveas_Test.pdf", null, null, TEMPFOLDER, null, null, new Dictionary<string, string> { { "OnePagePerSheet", "false" } }); |
| 49 | + Assert.IsInstanceOf<SaveResponse>(response, "response is System.IO.Stream"); |
| 50 | + } |
| 51 | + |
| 52 | + [Test] |
| 53 | + public void CellsCELLSCLOUD_Extand_Export_Test() |
| 54 | + { |
| 55 | + LightCellsApi lightCellsApi = new LightCellsApi(clientId, clientSecret, apiVersion, testbaseurl); |
| 56 | + IDictionary<string, Stream> files = new Dictionary<string, Stream>(); |
| 57 | + files.Add(BOOK1, GetTestDataStream(BOOK1)); |
| 58 | + files.Add(MYDOC, GetTestDataStream(MYDOC)); |
| 59 | + var filesResult = lightCellsApi.PostExport(files, "workbook", "pdf", new Dictionary<string, string> { { "OnePagePerSheet", "false" } }); |
| 60 | + Assert.IsInstanceOf<FilesResult>(filesResult, "response is AccessTokenResponse"); |
| 61 | + } |
| 62 | + [Test] |
| 63 | + public void CellsCELLSCLOUD_Extand_Convert_Test() |
| 64 | + { |
| 65 | + UpdateDataFile(instance, TEMPFOLDER, BOOK1); |
| 66 | + string workbook = "customerOutput.xlsx"; |
| 67 | + string format = "pdf"; |
| 68 | + string password = null; |
| 69 | + string outPath = null; |
| 70 | + UpdateDataFile(instance, TEMPFOLDER, BOOK1); |
| 71 | + var response = instance.CellsWorkbookPutConvertWorkbook(GetTestDataStream(workbook), format, password, outPath, null, new Dictionary<string, string> { { "OnePagePerSheet", "false" } }); |
| 72 | + Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream"); |
| 73 | + |
| 74 | + using (FileStream fileStream = File.Create("CellsCELLSCLOUD_Extand_Convert_Test.pdf")) |
| 75 | + { |
| 76 | + fileStream.Position = 0; |
| 77 | + response.CopyTo(fileStream); |
| 78 | + fileStream.Close(); |
| 79 | + } |
| 80 | + |
| 81 | + } |
| 82 | + } |
| 83 | +} |
0 commit comments