public void TestPointers()
        {
            // setup
            var obj    = GetFakeObj();
            var result = _client.CreateObject(obj).Result;

            // check creating pointer worked
            Assert.AreEqual(obj.SomePointer.ObjectId, result.SomePointer.ObjectId);

            // move the pointer
            result.SomePointer = new MyUser {
                ObjectId = VALID_USER_ID2
            };
            _client.Update(result);
            var result2 = _client.GetObject <ParseUnitTestObj>(result.ObjectId).Result;

            Assert.AreEqual(result.SomePointer.ObjectId, result2.SomePointer.ObjectId);

            // remove the pointer
            result.SomePointer = null;
            _client.Update(result);
            var result3 = _client.GetObject <ParseUnitTestObj>(result.ObjectId).Result;

            Assert.IsNull(result3.SomePointer);

            // tear down
            _client.DeleteObject(result);
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="image"></param>
 public void Update(InstagramFeed.InstagramImage image)
 {
     InstagramFeed.Parse.InstagramImage persistedImaged = new InstagramFeed.Parse.InstagramImage
     {
         ObjectId         = image.id,
         caption          = image.caption,
         created          = image.created,
         imageLink        = image.imageLink,
         instagramImageId = image.instagramImageId,
         link             = image.link,
         thumbLink        = image.thumbLink,
         userFullName     = image.userFullName,
         userThumbnail    = image.userThumbnail,
         userId           = image.userId,
         longitude        = image.longitude,
         latitude         = image.latitude,
         username         = image.username,
         isBlocked        = image.isBlocked,
         votes            = image.votes
     };
     _client.Update(persistedImaged);
 }