Ejemplo n.º 1
0
 public void UpdateSpecificFieldsOfAParseObjectViaQuery()
 {
     var o = new ComplexParseObjectClass {Id = "heh"};
      Server.Stub(new ApiExpectation { Method = "PUT", Url = "/1/classes/ComplexParseObjectClass/heh", Request = "{\"Name\":\"new name\",\"PowerLevel\":499}", Response = "{}" });
      new Driver().Objects.Update(o).Set(c => c.Name, "new name").Set(c => c.PowerLevel, 499).Execute(SetIfSuccess);
      WaitOne();
 }
Ejemplo n.º 2
0
 public void SendsAnIncrementRequestForParseObject()
 {
     var complex = new ComplexParseObjectClass {Id = "theid3"};
      Server.Stub(new ApiExpectation { Method = "PUT", Url = "/1/classes/ComplexParseObjectClass/theid3", Request = "{\"PowerLevel\":{\"__op\":\"Increment\",\"amount\":1762}}", Response = "{Length: 484, updatedAt: '2011-08-21T18:02:52.248Z' }" });
      new Driver().Objects.Increment(complex, o => o.PowerLevel, 1762, r =>
      {
     Assert.AreEqual(484, r.Data);
     SetIfSuccess(r);
      });
      WaitOne();
 }
Ejemplo n.º 3
0
        public void UpdateSpecificFieldsOfAParseObjectViaQuery()
        {
            var o = new ComplexParseObjectClass {
                Id = "heh"
            };

            Server.Stub(new ApiExpectation {
                Method = "PUT", Url = "/1/classes/ComplexParseObjectClass/heh", Request = "{\"Name\":\"new name\",\"PowerLevel\":499}", Response = "{}"
            });
            new Driver().Objects.Update(o).Set(c => c.Name, "new name").Set(c => c.PowerLevel, 499).Execute(SetIfSuccess);
            WaitOne();
        }
Ejemplo n.º 4
0
        public void SendsAnIncrementRequestForParseObject()
        {
            var complex = new ComplexParseObjectClass {
                Id = "theid3"
            };

            Server.Stub(new ApiExpectation {
                Method = "PUT", Url = "/1/classes/ComplexParseObjectClass/theid3", Request = "{\"PowerLevel\":{\"__op\":\"Increment\",\"amount\":1762}}", Response = "{Length: 484, updatedAt: '2011-08-21T18:02:52.248Z' }"
            });
            new Driver().Objects.Increment(complex, o => o.PowerLevel, 1762, r =>
            {
                Assert.AreEqual(484, r.Data);
                SetIfSuccess(r);
            });
            WaitOne();
        }