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

31 lines
1.0 KiB
C#
Raw Normal View History

using NUnit.Framework;
using System.Threading;
using System.Threading.Tasks;
using LeanCloud;
namespace LeanCloudTests {
public class ObjectControllerTests {
[SetUp]
public void SetUp() {
AVClient.Initialize(new AVClient.Configuration {
ApplicationId = "BMYV4RKSTwo8WSqt8q9ezcWF-gzGzoHsz",
ApplicationKey = "pbf6Nk5seyjilexdpyrPwjSp",
ApiServer = "https://avoscloud.com"
});
AVClient.HttpLog(TestContext.Out.WriteLine);
}
[Test]
public async Task TestSave() {
TestContext.Out.WriteLine($"before at {Thread.CurrentThread.ManagedThreadId}");
var obj = AVObject.Create("Foo");
obj["content"] = "hello, world";
await obj.SaveAsync();
2019-08-06 12:16:17 +08:00
TestContext.Out.WriteLine($"{obj.ObjectId} saved at {Thread.CurrentThread.ManagedThreadId}");
Assert.NotNull(obj.ObjectId);
Assert.NotNull(obj.CreatedAt);
Assert.NotNull(obj.UpdatedAt);
}
}
}