Skip to content

Commit b930368

Browse files
committed
Release Aspose.Cells Cloud SDK 19.9.
1 parent e3e7d43 commit b930368

File tree

179 files changed

+69799
-69654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+69799
-69654
lines changed

Aspose.Cells-Cloud.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>Aspose.Cells-Cloud</id>
5-
<version>19.6</version>
5+
<version>19.9</version>
66
<title>Aspose.Cells Cloud SDK for .NET</title>
77
<authors>Naeem</authors>
88
<owners>asposecloud</owners>

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

Lines changed: 70 additions & 89 deletions
Large diffs are not rendered by default.

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

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

11-
using System;
12-
using System.IO;
13-
using System.Collections.Generic;
14-
using System.Collections.ObjectModel;
15-
using System.Linq;
16-
using System.Reflection;
17-
using RestSharp;
1811
using NUnit.Framework;
19-
20-
using Aspose.Cells.Cloud.SDK.Client;
2112
using Aspose.Cells.Cloud.SDK.Api;
2213
using Aspose.Cells.Cloud.SDK.Model;
2314

@@ -33,14 +24,14 @@ namespace Aspose.Cells.Cloud.SDK.Test
3324
[TestFixture]
3425
public class CellsAutoFilterApiTests :CellsBaseTest
3526
{
36-
private CellsAutoFilterApi instance;
27+
private CellsApi instance;
3728
/// <summary>
3829
/// Setup before each unit test
3930
/// </summary>
4031
[SetUp]
4132
public void Init()
4233
{
43-
instance = new CellsAutoFilterApi(GetConfiguration());
34+
instance = new CellsApi( clientId, clientSecret);;
4435
}
4536

4637
/// <summary>
@@ -52,17 +43,7 @@ public void Cleanup()
5243

5344
}
5445

55-
/// <summary>
56-
/// Test an instance of CellsAutoFilterApi
57-
/// </summary>
58-
[Test]
59-
public void InstanceTest()
60-
{
61-
// TODO uncomment below to test 'IsInstanceOfType' CellsAutoFilterApi
62-
Assert.IsInstanceOf(typeof(CellsAutoFilterApi), instance, "instance is a CellsAutoFilterApi");
63-
}
64-
65-
46+
6647
/// <summary>
6748
/// Test CellsAutoFilterDeleteWorksheetDateFilter
6849
/// </summary>
@@ -81,9 +62,9 @@ public void CellsAutoFilterDeleteWorksheetDateFilterTest()
8162
int? minute = 1;
8263
int? second = 1;
8364
string folder = TEMPFOLDER;
84-
UpdateDataFile(TEMPFOLDER, BOOK1);
65+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
8566
var response = instance.CellsAutoFilterDeleteWorksheetDateFilter(name, sheetName, fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second, folder);
86-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
67+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
8768
Assert.AreEqual(response.Code, 200);
8869
}
8970

@@ -99,9 +80,9 @@ public void CellsAutoFilterDeleteWorksheetFilterTest()
9980
int? fieldIndex = 1;
10081
string criteria = "test";
10182
string folder = TEMPFOLDER;
102-
UpdateDataFile(TEMPFOLDER, BOOK1);
83+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
10384
var response = instance.CellsAutoFilterDeleteWorksheetFilter(name, sheetName, fieldIndex, criteria, folder);
104-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
85+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
10586
Assert.AreEqual(response.Code, 200);
10687
}
10788

@@ -115,7 +96,7 @@ public void CellsAutoFilterGetWorksheetAutoFilterTest()
11596
string name = BOOK1;
11697
string sheetName = SHEET1;
11798
string folder = TEMPFOLDER;
118-
UpdateDataFile(TEMPFOLDER, BOOK1);
99+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
119100
var response = instance.CellsAutoFilterGetWorksheetAutoFilter(name, sheetName, folder);
120101
Assert.IsInstanceOf<AutoFilterResponse>(response, "response is AutoFilterResponse");
121102
Assert.AreEqual(response.Code, 200);
@@ -131,9 +112,9 @@ public void CellsAutoFilterPostWorksheetAutoFilterRefreshTest()
131112
string name = BOOK1;
132113
string sheetName = SHEET1;
133114
string folder = TEMPFOLDER;
134-
UpdateDataFile(TEMPFOLDER, BOOK1);
115+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
135116
var response = instance.CellsAutoFilterPostWorksheetAutoFilterRefresh(name, sheetName, folder);
136-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
117+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
137118
Assert.AreEqual(response.Code, 200);
138119
}
139120

@@ -148,9 +129,9 @@ public void CellsAutoFilterPostWorksheetMatchBlanksTest()
148129
string sheetName = SHEET1;
149130
int? fieldIndex = 0;
150131
string folder = TEMPFOLDER;
151-
UpdateDataFile(TEMPFOLDER, BOOK1);
132+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
152133
var response = instance.CellsAutoFilterPostWorksheetMatchBlanks(name, sheetName, fieldIndex, folder);
153-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
134+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
154135
Assert.AreEqual(response.Code, 200);
155136
}
156137

@@ -165,9 +146,9 @@ public void CellsAutoFilterPostWorksheetMatchNonBlanksTest()
165146
string sheetName = SHEET1;
166147
int? fieldIndex = 0;
167148
string folder = TEMPFOLDER;
168-
UpdateDataFile(TEMPFOLDER, BOOK1);
149+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
169150
var response = instance.CellsAutoFilterPostWorksheetMatchNonBlanks(name, sheetName, fieldIndex, folder);
170-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
151+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
171152
Assert.AreEqual(response.Code, 200);
172153
}
173154

@@ -193,9 +174,9 @@ public void CellsAutoFilterPutWorksheetColorFilterTest()
193174
bool? matchBlanks = true;
194175
bool? refresh = true;
195176
string folder = TEMPFOLDER;
196-
UpdateDataFile(TEMPFOLDER, BOOK1);
177+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
197178
var response = instance.CellsAutoFilterPutWorksheetColorFilter(name, sheetName, range, fieldIndex, colorFilter, matchBlanks, refresh, folder);
198-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
179+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
199180
Assert.AreEqual(response.Code, 200);
200181
}
201182

@@ -218,9 +199,9 @@ public void CellsAutoFilterPutWorksheetCustomFilterTest()
218199
bool? matchBlanks = true;
219200
bool? refresh = false;
220201
string folder = TEMPFOLDER;
221-
UpdateDataFile(TEMPFOLDER, BOOK1);
202+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
222203
var response = instance.CellsAutoFilterPutWorksheetCustomFilter(name, sheetName, range, fieldIndex, operatorType1, criteria1, isAnd, operatorType2, criteria2, matchBlanks, refresh, folder);
223-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
204+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
224205
Assert.AreEqual(response.Code, 200);
225206
}
226207

@@ -245,9 +226,9 @@ public void CellsAutoFilterPutWorksheetDateFilterTest()
245226
bool? matchBlanks = true;
246227
bool? refresh = true;
247228
string folder = TEMPFOLDER;
248-
UpdateDataFile(TEMPFOLDER , BOOK1);
229+
UpdateDataFile(instance,TEMPFOLDER , BOOK1);
249230
var response = instance.CellsAutoFilterPutWorksheetDateFilter(name, sheetName, range, fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second, matchBlanks, refresh, folder);
250-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
231+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
251232
Assert.AreEqual(response.Code, 200);
252233
}
253234

@@ -266,9 +247,9 @@ public void CellsAutoFilterPutWorksheetDynamicFilterTest()
266247
bool? matchBlanks = true;
267248
bool? refresh = true;
268249
string folder = TEMPFOLDER;
269-
UpdateDataFile(TEMPFOLDER, BOOK1);
250+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
270251
var response = instance.CellsAutoFilterPutWorksheetDynamicFilter(name, sheetName, range, fieldIndex, dynamicFilterType, matchBlanks, refresh, folder);
271-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
252+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
272253
Assert.AreEqual(response.Code, 200);
273254
}
274255

@@ -287,9 +268,9 @@ public void CellsAutoFilterPutWorksheetFilterTest()
287268
bool? matchBlanks = true;
288269
bool? refresh = true;
289270
string folder = TEMPFOLDER;
290-
UpdateDataFile(TEMPFOLDER, BOOK1);
271+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
291272
var response = instance.CellsAutoFilterPutWorksheetFilter(name, sheetName, range, fieldIndex, criteria, matchBlanks, refresh, folder);
292-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
273+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
293274
Assert.AreEqual(response.Code, 200);
294275
}
295276

@@ -310,9 +291,9 @@ public void CellsAutoFilterPutWorksheetFilterTop10Test()
310291
bool? matchBlanks = null;
311292
bool? refresh = null;
312293
string folder = TEMPFOLDER;
313-
UpdateDataFile(TEMPFOLDER, BOOK1);
294+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
314295
var response = instance.CellsAutoFilterPutWorksheetFilterTop10(name, sheetName, range, fieldIndex, isTop, isPercent, itemCount, matchBlanks, refresh, folder);
315-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
296+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
316297
Assert.AreEqual(response.Code, 200);
317298
}
318299

@@ -332,9 +313,9 @@ public void CellsAutoFilterPutWorksheetIconFilterTest()
332313
bool? matchBlanks = null;
333314
bool? refresh = null;
334315
string folder = TEMPFOLDER;
335-
UpdateDataFile(TEMPFOLDER, BOOK1);
316+
UpdateDataFile(instance,TEMPFOLDER, BOOK1);
336317
var response = instance.CellsAutoFilterPutWorksheetIconFilter(name, sheetName, range, fieldIndex, iconSetType, iconId, matchBlanks, refresh, folder);
337-
Assert.IsInstanceOf<SaaSposeResponse>(response, "response is SaaSposeResponse");
318+
Assert.IsInstanceOf<CellsCloudResponse>(response, "response is CellsCloudResponse");
338319
Assert.AreEqual(response.Code, 200);
339320
}
340321

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

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

11-
using System;
12-
using System.IO;
13-
using System.Collections.Generic;
14-
using System.Collections.ObjectModel;
15-
using System.Linq;
16-
using System.Reflection;
17-
using RestSharp;
1811
using NUnit.Framework;
19-
20-
using Aspose.Cells.Cloud.SDK.Client;
2112
using Aspose.Cells.Cloud.SDK.Api;
2213
using Aspose.Cells.Cloud.SDK.Model;
2314

@@ -33,15 +24,15 @@ namespace Aspose.Cells.Cloud.SDK.Test
3324
[TestFixture]
3425
public class CellsAutoshapesApiTests :CellsBaseTest
3526
{
36-
private CellsAutoshapesApi instance;
27+
private CellsApi instance;
3728

3829
/// <summary>
3930
/// Setup before each unit test
4031
/// </summary>
4132
[SetUp]
4233
public void Init()
4334
{
44-
instance = new CellsAutoshapesApi(GetConfiguration());
35+
instance = new CellsApi( clientId, clientSecret);
4536
}
4637

4738
/// <summary>
@@ -53,16 +44,6 @@ public void Cleanup()
5344

5445
}
5546

56-
/// <summary>
57-
/// Test an instance of CellsAutoshapesApi
58-
/// </summary>
59-
[Test]
60-
public void InstanceTest()
61-
{
62-
// TODO uncomment below to test 'IsInstanceOfType' CellsAutoshapesApi
63-
Assert.IsInstanceOf(typeof(CellsAutoshapesApi), instance, "instance is a CellsAutoshapesApi");
64-
}
65-
6647

6748
/// <summary>
6849
/// Test CellsAutoshapesGetWorksheetAutoshape
@@ -75,7 +56,7 @@ public void CellsAutoshapesGetWorksheetAutoshapeTest()
7556
string sheetName = SHEET2;
7657
int? autoshapeNumber = 4;
7758
string folder = TEMPFOLDER;
78-
UpdateDataFile(folder, name);
59+
UpdateDataFile(instance,folder, name);
7960
var response = instance.CellsAutoshapesGetWorksheetAutoshape(name, sheetName, autoshapeNumber, "PNG", folder);
8061
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
8162
}
@@ -90,7 +71,7 @@ public void CellsAutoshapesGetWorksheetAutoshapeDTOTest()
9071
string sheetName = SHEET2;
9172
int? autoshapeNumber = 4;
9273
string folder = TEMPFOLDER;
93-
UpdateDataFile(folder, name);
74+
UpdateDataFile(instance,folder, name);
9475
var response = instance.CellsAutoshapesGetWorksheetAutoshape(name, sheetName, autoshapeNumber, null, folder);
9576
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
9677
}
@@ -104,7 +85,7 @@ public void CellsAutoshapesGetWorksheetAutoshapesTest()
10485
string name = MYDOC;
10586
string sheetName = SHEET2;
10687
string folder = TEMPFOLDER;
107-
UpdateDataFile(folder, name);
88+
UpdateDataFile(instance,folder, name);
10889
var response = instance.CellsAutoshapesGetWorksheetAutoshapes(name, sheetName, folder);
10990
Assert.IsInstanceOf<AutoShapesResponse>(response, "response is AutoShapesResponse");
11091
Assert.AreEqual(response.Code, 200);

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

Lines changed: 19 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class CellsBaseTest
1212
{
1313
protected ApiClient client;
1414
protected Client.Configuration config;
15-
protected static OAuthApi oauth2 =null;
1615
protected string grantType = "client_credentials";
1716
protected string clientId = "66164C51-693E-4904-A121-545961673EC1";
1817
protected string clientSecret = "536e76768419db9585afdd37bb5f7533";
@@ -36,56 +35,31 @@ public class CellsBaseTest
3635
protected string CELLAREA = "A1:C10";
3736
protected StorageApi storageApi;
3837
private string TestDataFolder = @"D:\Projects\Aspose\Aspose.Cloud\Aspose.Cells.Cloud.SDK\src\TestData\";
39-
protected void UpdateDataFile( string folder, string filename)
38+
39+
protected void UpdateDataFile( CellsApi cellsApi, string folder, string filename)
4040
{
41-
this.storageApi = new StorageApi( clientSecret, clientId);
42-
DeleteFileRequest file = new DeleteFileRequest();
43-
PutCreateRequest newfile = new PutCreateRequest();
44-
if (string.IsNullOrEmpty(folder))
45-
{
46-
file.Path = filename;
47-
newfile.Path = filename;
48-
newfile.File = File.Open(TestDataFolder + filename, FileMode.Open);
49-
}
50-
else
51-
{
52-
file.Path = folder + "/" + filename;
53-
newfile.Path = folder + "/" + filename;
54-
newfile.File = File.Open(TestDataFolder + filename, FileMode.Open);
55-
}
56-
storageApi.DeleteFile(file);
57-
storageApi.PutCreate(newfile);
58-
newfile.File.Close();
41+
cellsApi.DeleteFile(folder + @"\" + filename);
42+
Stream stream = GetTestDataStream(filename);
43+
var response = cellsApi.UploadFile(folder + @"\" + filename, stream);
5944
}
60-
protected void UpdateDataFileForDropBox(string folder, string filename)
45+
protected void UpdateDataFile(CellsApi cellsApi, string filename)
6146
{
62-
this.storageApi = new StorageApi(clientSecret, clientId);
63-
DeleteFileRequest file = new DeleteFileRequest();
64-
PutCreateRequest newfile = new PutCreateRequest();
65-
file.Storage = "DropBox";
66-
newfile.Storage = "DropBox";
67-
if (string.IsNullOrEmpty(folder))
68-
{
69-
file.Path = filename;
70-
newfile.Path = filename;
71-
newfile.File = File.Open(TestDataFolder + filename, FileMode.Open);
72-
}
73-
else
74-
{
75-
file.Path = folder + "/" + filename;
76-
newfile.Path = folder + "/" + filename;
77-
newfile.File = File.Open(TestDataFolder + filename, FileMode.Open);
78-
}
79-
this.storageApi.DeleteFile(file);
80-
this.storageApi.PutCreate(newfile);
81-
newfile.File.Close();
47+
cellsApi.DeleteFile( filename);
48+
Stream stream = GetTestDataStream(filename);
49+
var response = cellsApi.UploadFile( filename, stream);
8250
}
51+
protected void UpdateDataFileForDropBox(CellsApi cellsApi, string folder, string filename)
52+
{
53+
cellsApi.DeleteFile(folder + @"\" + filename, "DropBox");
54+
Stream stream = GetTestDataStream(filename);
55+
var response = cellsApi.UploadFile(folder + @"\" + filename, stream, "DropBox");
56+
}
57+
8358
protected Stream GetTestDataStream( string filename)
8459
{
8560
MemoryStream ms = new MemoryStream();
86-
StreamWriter writer = new StreamWriter(ms);
87-
writer.Write(System.Text.Encoding.Default.GetString(File.ReadAllBytes(TestDataFolder + filename)));
88-
writer.Flush();
61+
FileStream fs = File.OpenRead(TestDataFolder + filename);
62+
fs.CopyTo(ms);
8963
ms.Position = 0;
9064
return ms;
9165
}
@@ -99,20 +73,6 @@ protected void WriteResponseStream(string filename, Stream stream)
9973
stream.CopyTo(fs);
10074
fs.Close();
10175
}
102-
protected Client.Configuration GetConfiguration()
103-
{
104-
if (oauth2 == null)
105-
{
106-
oauth2 = new OAuthApi("https://api.aspose.cloud");
107-
var oauth2response = oauth2.OAuthPost(grantType, clientId, clientSecret);
108-
accesstoken = oauth2response.AccessToken;
109-
refreshtoken = oauth2response.RefreshToken;
110-
}
111-
Dictionary<string, string> headerParameters = new Dictionary<string, string>();
112-
headerParameters.Add("Authorization", "Bearer " + accesstoken);
113-
client = new ApiClient();
114-
config = new Client.Configuration(client, headerParameters);
115-
return config;
116-
}
76+
11777
}
11878
}

0 commit comments

Comments
 (0)