test: 简单的查询测试

oneRain 2019-08-06 15:21:39 +08:00
parent 56a051080a
commit 4e1139a73b
1 changed files with 11 additions and 3 deletions

View File

@ -10,15 +10,23 @@ namespace LeanCloudTests {
AVClient.Initialize(new AVClient.Configuration { AVClient.Initialize(new AVClient.Configuration {
ApplicationId = "BMYV4RKSTwo8WSqt8q9ezcWF-gzGzoHsz", ApplicationId = "BMYV4RKSTwo8WSqt8q9ezcWF-gzGzoHsz",
ApplicationKey = "pbf6Nk5seyjilexdpyrPwjSp", ApplicationKey = "pbf6Nk5seyjilexdpyrPwjSp",
RTMServer = "https://router-g0-push.avoscloud.com", ApiServer = "https://avoscloud.com"
}); });
AVClient.HttpLog(TestContext.Out.WriteLine); AVClient.HttpLog(TestContext.Out.WriteLine);
} }
[Test] [Test]
public async Task TestQuery() { public async Task TestQuery() {
var query = new AVQuery<AVObject>("Foo"); var query = new AVQuery<AVObject>("Foo").WhereEqualTo("content", "hello");
query.WhereEqualTo("content", "hello, world"); var results = await query.FindAsync();
foreach (var result in results) {
TestContext.Out.WriteLine(result.ObjectId);
}
}
[Test]
public async Task TestQueryCount() {
var query = new AVQuery<AVObject>("Foo").WhereEqualTo("content", "hello, world");
var count = await query.CountAsync(); var count = await query.CountAsync();
Assert.Greater(count, 8); Assert.Greater(count, 8);
} }