Skip to content

Commit 483ce2d

Browse files
committed
Aspose.Cells Cloud SDK for .NET 20.4
1 parent a5f0f40 commit 483ce2d

14 files changed

+835
-254
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,5 @@ SDKs/PHP/vendor/*
113113
SDKs/PHP/testReports/*
114114
SDKs/servercreds.json
115115
/.vs
116+
Aspose.Cells-Cloud.nuspec
117+
.vs

Aspose.Cells-Cloud.nuspec

Lines changed: 0 additions & 27 deletions
This file was deleted.

Aspose.Cells.Cloud.SDK.Test/Api/CellsBaseTest.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ namespace Aspose.Cells.Cloud.SDK.Test
33
{
44
using Aspose.Cells.Cloud.SDK.Client;
55
using Aspose.Cells.Cloud.SDK.Api;
6-
using Aspose.Storage.Cloud.Sdk.Api;
7-
using Aspose.Storage.Cloud.Sdk.Model;
8-
using Aspose.Storage.Cloud.Sdk.Model.Requests;
96
using System.IO;
10-
using System.Collections.Generic;
117
public class CellsBaseTest
128
{
139
protected ApiClient client;
1410
protected Client.Configuration config;
1511
protected string grantType = "client_credentials";
16-
protected string clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
17-
protected string clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
12+
protected string clientId = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx";
13+
protected string clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxx";
1814
protected static string accesstoken;
1915
protected string refreshtoken;
2016
protected string BOOK1 = "Book1.xlsx";
@@ -33,7 +29,6 @@ public class CellsBaseTest
3329
protected string CellName = "A1";
3430
protected string RANGE = "A1:C10";
3531
protected string CELLAREA = "A1:C10";
36-
protected StorageApi storageApi;
3732
private string TestDataFolder = @"D:\Projects\Aspose\Aspose.Cloud\Aspose.Cells.Cloud.SDK\src\TestData\";
3833

3934
protected void UpdateDataFile( CellsApi cellsApi, string folder, string filename)

Aspose.Cells.Cloud.SDK.Test/Api/CellsStorageApiTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public void CellsCreateAndDeleteFolderTest()
140140
instance.CreateFolder(TEMPFOLDER+1);
141141

142142
instance.DeleteFolder(TEMPFOLDER + 1);
143+
instance.DeleteFolder("ruby");
143144
}
144145

145146
/// <summary>

Aspose.Cells.Cloud.SDK.Test/Api/CellsWorkbookApiTests.cs

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@
99
*/
1010

1111
using System;
12-
using System.IO;
1312
using System.Collections.Generic;
14-
using System.Collections.ObjectModel;
15-
using System.Linq;
16-
using System.Reflection;
17-
using RestSharp;
1813
using NUnit.Framework;
19-
20-
using Aspose.Cells.Cloud.SDK.Client;
2114
using Aspose.Cells.Cloud.SDK.Api;
2215
using Aspose.Cells.Cloud.SDK.Model;
2316

@@ -407,7 +400,7 @@ public void CellsWorkbookPostWorkbookSplitTest()
407400
int? verticalResolution = 90;
408401
string folder = TEMPFOLDER;
409402
UpdateDataFile(instance,folder, name);
410-
var response = instance.CellsWorkbookPostWorkbookSplit(name, format, from, to, horizontalResolution, verticalResolution, folder);
403+
var response = instance.CellsWorkbookPostWorkbookSplit(name, format,from, to, horizontalResolution, verticalResolution, folder);
411404
Assert.IsInstanceOf<SplitResultResponse>(response, "response is SplitResultResponse");
412405
Assert.AreEqual(response.Code, 200);
413406
}
@@ -474,7 +467,7 @@ public void CellsWorkbookPutConvertWorkBookTest()
474467
string password = null;
475468
string outPath = null;
476469
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
477-
var response = instance.CellsWorkbookPutConvertWorkbook(GetTestDataByteArray(workbook),format, password, outPath);
470+
var response = instance.CellsWorkbookPutConvertWorkbook(GetTestDataStream(workbook),format, password, outPath);
478471
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
479472
//WriteResponseStream(workbook + "." + format, response);
480473
}
@@ -491,7 +484,7 @@ public void CellsWorkbookPutConvertMDTest()
491484
string password = null;
492485
string outPath = null;
493486
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
494-
var response = instance.CellsWorkbookPutConvertWorkbook(GetTestDataByteArray(workbook), format, password, outPath);
487+
var response = instance.CellsWorkbookPutConvertWorkbook(GetTestDataStream(workbook), format, password, outPath);
495488
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
496489
//WriteResponseStream(workbook + "." + format, response);
497490
}
@@ -527,13 +520,13 @@ public void CellsWorkbookPutWorkbookCreateTest()
527520
string folder = TEMPFOLDER;
528521
UpdateDataFile(instance,folder, templateFile);
529522
UpdateDataFile(instance,folder, dataFile);
530-
var response = instance.CellsWorkbookPutWorkbookCreate(name, folder + "/" + templateFile, folder +"/"+ dataFile, folder);
523+
var response = instance.CellsWorkbookPutWorkbookCreate(name, folder + "/" + templateFile, folder +"/"+ dataFile, false, folder);
531524
Assert.IsInstanceOf<WorkbookResponse>(response, "response is WorkbookResponse");
532525
Assert.AreEqual(response.Code, 200);
533526

534527
}
535528

536-
[Test]
529+
[Ignore("Ignore DropBox")]
537530
public void CellsWorkbookPostWorkbooksTextSearchTestForDropBox()
538531
{
539532
string name = BOOK1;
@@ -545,6 +538,55 @@ public void CellsWorkbookPostWorkbooksTextSearchTestForDropBox()
545538
Assert.AreEqual(response.Code, 200);
546539
}
547540

541+
/// <summary>
542+
/// Test CellsWorkbookPutBackgroupTest
543+
/// </summary>
544+
[Test]
545+
public void CellsWorkbookPutBackgroupTest()
546+
{
547+
// TODO uncomment below to test the method and replace null with proper value
548+
string name = BOOK1;
549+
string folder = TEMPFOLDER;
550+
UpdateDataFile(instance, folder, name);
551+
var response = instance.CellsWorkbookPutWorkbookBackground(name, GetTestDataByteArray("WaterMark.png"), folder);
552+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is WorkbookResponse");
553+
Assert.AreEqual(response.Code, 200);
554+
555+
}
556+
557+
/// <summary>
558+
/// Test CellsWorkbookPutBackgroupTest
559+
/// </summary>
560+
[Test]
561+
public void CellsWorkbookDeleteBackgroupTest()
562+
{
563+
// TODO uncomment below to test the method and replace null with proper value
564+
string name = BOOK1;
565+
string folder = TEMPFOLDER;
566+
UpdateDataFile(instance, folder, name);
567+
var response = instance.CellsWorkbookDeleteWorkbookBackground(name, folder);
568+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is WorkbookResponse");
569+
Assert.AreEqual(response.Code, 200);
570+
}
571+
572+
/// <summary>
573+
/// Test CellsWorkbookPutWorkbookCreate
574+
/// </summary>
575+
[Test]
576+
public void CellsWorkbookPutWorkbookCreateNewTest()
577+
{
578+
// TODO uncomment below to test the method and replace null with proper value
579+
string name = "NewBook" + DateTime.Now.ToString("yymmddhhmiss") + ".xlsx";
580+
string templateFile = BOOK1;
581+
string dataFile = "ReportData.xml";
582+
string folder = TEMPFOLDER;
583+
UpdateDataFile(instance, folder, templateFile);
584+
UpdateDataFile(instance, folder, dataFile);
585+
var response = instance.CellsWorkbookPutWorkbookCreate(name, folder + "/" + templateFile, folder + "/" + dataFile, false,folder);
586+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is WorkbookResponse");
587+
Assert.AreEqual(response.Code, 200);
588+
589+
}
548590
}
549591

550592
}

Aspose.Cells.Cloud.SDK.Test/Api/CellsWorksheetsApiTests.cs

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
* Generated by: https://github.com/swagger-api/swagger-codegen.git
99
*/
1010

11-
using System;
1211
using System.IO;
13-
using System.Collections.Generic;
14-
using System.Collections.ObjectModel;
15-
using System.Linq;
16-
using System.Reflection;
17-
using RestSharp;
1812
using NUnit.Framework;
19-
20-
using Aspose.Cells.Cloud.SDK.Client;
2113
using Aspose.Cells.Cloud.SDK.Api;
2214
using Aspose.Cells.Cloud.SDK.Model;
2315

@@ -185,7 +177,7 @@ public void CellsWorksheetsGetWorkSheetTest()
185177
string format = "png";
186178
string folder = TEMPFOLDER;
187179
UpdateDataFile(instance,folder, name);
188-
var response = instance.CellsWorksheetsGetWorksheet(name, sheetName, format, verticalResolution, horizontalResolution, folder);
180+
var response = instance.CellsWorksheetsGetWorksheet(name, sheetName, format, verticalResolution, horizontalResolution, null,null,folder);
189181
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
190182

191183
}
@@ -203,11 +195,11 @@ public void CellsWorksheetsGetWorkSheetToPDFTest()
203195
string format = "pdf";
204196
string folder = TEMPFOLDER;
205197
//UpdateDataFile(instance,folder, name);
206-
var response = instance.CellsWorksheetsGetWorksheet(name, sheetName, format, verticalResolution, horizontalResolution, folder);
198+
var response = instance.CellsWorksheetsGetWorksheet(name, sheetName, format, verticalResolution, horizontalResolution, null,null,folder);
207199
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
208-
FileStream stream = File.Create(@"d:\book1.pdf");
209-
response.CopyTo(stream);
210-
stream.Close();
200+
//FileStream stream = File.Create(@"d:\book1.pdf");
201+
//response.CopyTo(stream);
202+
//stream.Close();
211203

212204
}
213205
/// <summary>
@@ -667,7 +659,44 @@ public void CellsWorksheetsPutWorksheetFreezePanesTest()
667659
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
668660
Assert.AreEqual(response.Code, 200);
669661
}
670-
662+
/// <summary>
663+
/// Test CellsWorksheetsGetWorkSheet
664+
/// </summary>
665+
[Test]
666+
public void CellsWorksheetsGetWorkSheetForAreaTest()
667+
{
668+
// TODO uncomment below to test the method and replace null with proper value
669+
string name = BOOK1;
670+
string sheetName = SHEET1;
671+
int? verticalResolution = 100;
672+
int? horizontalResolution = 90;
673+
string format = "png";
674+
string area = "B3:K8";
675+
string folder = TEMPFOLDER;
676+
UpdateDataFile(instance, folder, name);
677+
var response = instance.CellsWorksheetsGetWorksheet(name, sheetName, format, verticalResolution, horizontalResolution, area,null ,folder);
678+
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
679+
680+
}
681+
/// <summary>
682+
/// Test CellsWorksheetsGetWorkSheet
683+
/// </summary>
684+
[Test]
685+
public void CellsWorksheetsGetWorkSheetForPageIndexTest()
686+
{
687+
// TODO uncomment below to test the method and replace null with proper value
688+
string name = BOOK1;
689+
string sheetName = SHEET1;
690+
int? verticalResolution = 100;
691+
int? horizontalResolution = 90;
692+
string format = "png";
693+
int? pageIndex =1;
694+
string folder = TEMPFOLDER;
695+
UpdateDataFile(instance, folder, name);
696+
var response = instance.CellsWorksheetsGetWorksheet(name, sheetName, format, verticalResolution, horizontalResolution, null, pageIndex, folder);
697+
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
698+
699+
}
671700
}
672701

673702
}

Aspose.Cells.Cloud.SDK.Test/Api/OAuthApiTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Aspose.Cells.Cloud.SDK.Test
3131
/// Please update the test case below to test the API endpoint.
3232
/// </remarks>
3333
[TestFixture]
34-
public class OAuthApiTests
34+
public class OAuthApiTests:CellsBaseTest
3535
{
3636
private CellsApi instance;
3737

@@ -41,7 +41,7 @@ public class OAuthApiTests
4141
[SetUp]
4242
public void Init()
4343
{
44-
instance = new CellsApi("https://api.aspose.cloud");
44+
instance = new CellsApi(clientId, clientSecret);
4545
}
4646

4747
/// <summary>
@@ -59,9 +59,7 @@ public void Cleanup()
5959
public void OAuthPostTest()
6060
{
6161
// TODO uncomment below to test the method and replace null with proper value
62-
string grantType = "client_credentials";
63-
string clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
64-
string clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
62+
instance.Configuration.ApiClient = new ApiClient("https://api.aspose.cloud");
6563
var response = instance.OAuthPost(grantType, clientId, clientSecret);
6664
Assert.IsInstanceOf<AccessTokenResponse>(response, "response is AccessTokenResponse");
6765
Assert.IsNotNull(response.AccessToken);

Aspose.Cells.Cloud.SDK.Test/Aspose.Cells.Cloud.SDK.Test.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
<IsPackable>false</IsPackable>
66
<LangVersion>latest</LangVersion>
77
</PropertyGroup>
8-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
9-
<PackageReference Include="Aspose.Storage.Core-Cloud" Version="18.4.0" />
10-
</ItemGroup>
11-
<ItemGroup Condition="'$(TargetFramework)' == 'net4.5.2'">
12-
<PackageReference Include="Aspose.Storage-Cloud" Version="18.3.0" />
13-
</ItemGroup>
148
<ItemGroup>
159
<PackageReference Include="nunit" Version="3.11.0" />
1610
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />

0 commit comments

Comments
 (0)