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

35 lines
1.1 KiB
C#
Raw Normal View History

using NUnit.Framework;
using System;
using System.Threading.Tasks;
using LeanCloud;
namespace LeanCloudTests {
public class QueryTest {
[SetUp]
public void SetUp() {
AVClient.Initialize(new AVClient.Configuration {
ApplicationId = "BMYV4RKSTwo8WSqt8q9ezcWF-gzGzoHsz",
ApplicationKey = "pbf6Nk5seyjilexdpyrPwjSp",
2019-08-06 15:21:39 +08:00
ApiServer = "https://avoscloud.com"
});
AVClient.HttpLog(TestContext.Out.WriteLine);
}
[Test]
public async Task TestQuery() {
2019-08-06 15:21:39 +08:00
var query = new AVQuery<AVObject>("Foo").WhereEqualTo("content", "hello");
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();
Assert.Greater(count, 8);
}
}
}