Beispiel #1
0
        public async Task RPC()
        {
            List <object> result = await LCCloud.RPC("getTycoonList") as List <object>;

            IEnumerable <LCObject> tycoonList = result.Cast <LCObject>();

            foreach (LCObject item in tycoonList)
            {
                TestContext.WriteLine(item.ObjectId);
                Assert.NotNull(item.ObjectId);
            }
        }
Beispiel #2
0
        public async Task GetObjectMap()
        {
            object response = await LCCloud.RPC("getObjectMap");

            Dictionary <string, object> dict = response as Dictionary <string, object>;

            TestContext.WriteLine(dict.Count);
            Assert.Greater(dict.Count, 0);
            foreach (KeyValuePair <string, object> kv in dict)
            {
                LCObject obj = kv.Value as LCObject;
                Assert.AreEqual(kv.Key, obj.ObjectId);
            }
        }
Beispiel #3
0
        public async Task GetObject()
        {
            LCObject hello = new LCObject("Hello");
            await hello.Save();

            object reponse = await LCCloud.RPC("getObject", new Dictionary <string, object> {
                { "className", "Hello" },
                { "id", hello.ObjectId }
            });

            LCObject obj = reponse as LCObject;

            Assert.AreEqual(obj.ObjectId, hello.ObjectId);
        }
Beispiel #4
0
        public async Task GetObjects()
        {
            object response = await LCCloud.RPC("getObjects");

            List <object>          list    = response as List <object>;
            IEnumerable <LCObject> objects = list.Cast <LCObject>();

            TestContext.WriteLine(objects.Count());
            Assert.Greater(objects.Count(), 0);
            foreach (LCObject obj in objects)
            {
                int balance = (int)obj["balance"];
                Assert.Greater(balance, 100);
            }
        }