2019-07-30 16:47:10 +08:00
|
|
|
|
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",
|
2019-08-01 17:36:34 +08:00
|
|
|
|
ApiServer = "https://avoscloud.com"
|
2019-07-30 16:47:10 +08:00
|
|
|
|
});
|
|
|
|
|
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}");
|
2019-07-30 16:47:10 +08:00
|
|
|
|
Assert.NotNull(obj.ObjectId);
|
|
|
|
|
Assert.NotNull(obj.CreatedAt);
|
|
|
|
|
Assert.NotNull(obj.UpdatedAt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|