Ejemplo n.º 1
0
    public void TestBasicUpdate()
    {
      RunAndAwait( () =>
        {
          BaseUpdateEntityAsync baseUpdateEntity = new BaseUpdateEntityAsync();
          baseUpdateEntity.Name = "foobar";
          baseUpdateEntity.Age = 20;

          Backendless.Persistence.Save( baseUpdateEntity,
                                        new ResponseCallback<BaseUpdateEntityAsync>( this )
                                          {
                                            ResponseHandler = savedEntity =>
                                              {
                                                savedEntity.Name = "foobar1";
                                                savedEntity.Age = 21;

                                                Backendless.Persistence.Save( savedEntity,
                                                                              new ResponseCallback<BaseUpdateEntityAsync>(
                                                                                this )
                                                                                {
                                                                                  ResponseHandler = response =>
                                                                                    {
                                                                                      Backendless.Persistence
                                                                                                 .Of<BaseUpdateEntityAsync>()
                                                                                                 .Find(
                                                                                                   new ResponseCallback
                                                                                                     <
                                                                                                     BackendlessCollection
                                                                                                     <BaseUpdateEntityAsync>
                                                                                                     >( this )
                                                                                                     {
                                                                                                       ResponseHandler =
                                                                                                         collection =>
                                                                                                           {
                                                                                                             BaseUpdateEntityAsync
                                                                                                               foundEntity =
                                                                                                                 collection
                                                                                                                   .GetCurrentPage
                                                                                                                   ()[0];
                                                                                                             Assert.AreEqual
                                                                                                               ( savedEntity,
                                                                                                                 foundEntity,
                                                                                                                 "Server didn't update an entity" );
                                                                                                             Assert
                                                                                                               .IsNotNull(
                                                                                                                 foundEntity
                                                                                                                   .Updated,
                                                                                                                 "Server didn't set an updated field value" );

                                                                                                             CountDown();
                                                                                                           }
                                                                                                     } );
                                                                                    }
                                                                                } );
                                              }
                                          } );
        } );
    }
Ejemplo n.º 2
0
 protected bool Equals(BaseUpdateEntityAsync other)
 {
     return(Age == other.Age && string.Equals(Name, other.Name) && string.Equals(ObjectId, other.ObjectId) && string.Equals(Created, other.Created));
 }
Ejemplo n.º 3
0
 protected bool Equals( BaseUpdateEntityAsync other )
 {
     return Age == other.Age && string.Equals(Name, other.Name) && string.Equals(ObjectId, other.ObjectId) && string.Equals(Created, other.Created);
 }