using NUnit.Framework; using System.Collections.Generic; using System.Threading.Tasks; using System.Linq; using LeanCloud.Storage; using LeanCloud.Common; namespace LeanCloud.Test { public class CloudTest { [SetUp] public void SetUp() { Logger.LogDelegate += Utils.Print; LeanCloud.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com"); } [TearDown] public void TearDown() { Logger.LogDelegate -= Utils.Print; } [Test] public async Task Call() { Dictionary response = await LCCloud.Run("hello", parameters: new Dictionary { { "name", "world" } }); TestContext.WriteLine(response["result"]); Assert.AreEqual(response["result"], "hello, world"); } [Test] public async Task CallWithoutParams() { await LCCloud.Run("hello"); } [Test] public async Task RPC() { List result = await LCCloud.RPC("getTycoonList") as List; IEnumerable tycoonList = result.Cast(); foreach (LCObject item in tycoonList) { TestContext.WriteLine(item.ObjectId); Assert.NotNull(item.ObjectId); } } } }