csharp-sdk-upm/Storage/Storage.Test/FileTest.cs

32 lines
923 B
C#
Raw Normal View History

using NUnit.Framework;
using LeanCloud;
using System.IO;
using System.Threading.Tasks;
namespace LeanCloudTests {
public class FileTest {
[SetUp]
public void SetUp() {
//Utils.InitNorthChina();
Utils.InitEastChina();
//Utils.InitUS();
}
[Test]
public async Task SaveImage() {
AVFile file = new AVFile("hello.png", File.ReadAllBytes("hello.png"));
await file.SaveAsync();
Assert.NotNull(file.ObjectId);
TestContext.Out.WriteLine($"file: {file.ObjectId}, {file.Url}");
}
[Test]
public async Task SaveBigFile() {
AVFile file = new AVFile("test.apk", File.ReadAllBytes("test.apk"));
await file.SaveAsync();
Assert.NotNull(file.ObjectId);
TestContext.Out.WriteLine($"file: {file.ObjectId}, {file.Url}");
}
}
}