Esempio n. 1
0
        public void TestDeleteObject()
        {
            RunAndAwait(() =>
            {
                var entity = new BaseDeleteEntityAsync {
                    Name = "bot_#delete", Age = 20
                };
                IDataStore <BaseDeleteEntityAsync> connection = Backendless.Persistence.Of <BaseDeleteEntityAsync>();

                connection.Save(entity,
                                new ResponseCallback <BaseDeleteEntityAsync>(this)
                {
                    ResponseHandler =
                        savedEntity =>
                        connection.Remove(savedEntity,
                                          new ResponseCallback <long>(this)
                    {
                        ResponseHandler = response =>
                        {
                            connection.FindById(savedEntity.ObjectId,
                                                new AsyncCallback <BaseDeleteEntityAsync>(
                                                    @async =>
                                                    Assert.Fail("Server probably found a result"),
                                                    fault => testLatch.Signal()));
                        }
                    })
                });
            });
        }
Esempio n. 2
0
        public void TestDeleteObject()
        {
            RunAndAwait( () =>
            {
              var entity = new BaseDeleteEntityAsync {Name = "bot_#delete", Age = 20};
              IDataStore<BaseDeleteEntityAsync> connection = Backendless.Persistence.Of<BaseDeleteEntityAsync>();

              connection.Save( entity,
                           new ResponseCallback<BaseDeleteEntityAsync>( this )
                             {
                               ResponseHandler =
                                 savedEntity =>
                                 connection.Remove( savedEntity,
                                                    new ResponseCallback<long>( this )
                                                      {
                                                        ResponseHandler = response =>
                                                          {
                                                            connection.FindById( savedEntity.ObjectId,
                                                                             new AsyncCallback<BaseDeleteEntityAsync>(
                                                                               @async =>
                                                                               Assert.Fail( "Server probably found a result" ),
                                                                               fault => testLatch.Signal() ) );
                                                          }
                                                      } )
                             } );
            } );
        }