From the course: Building Android Apps with Azure

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Testing update and query

Testing update and query

- [Instructor] Now we are ready to test our updateItem and query methods that we've added. Now if we go into the testAddItem method, if we look at the bookmark instructor, notice that I have swapped the url and the notes fields around. So notes is currently www.yahoo.com and the url is test notes1. So let's add a new method. It will be a public method, return type void, and we will call this new method testUpdateAndQuery. In our new method, we are going to call syncAndRefresh and we're going to pass in a new AzureQueryCompleteListener. In the onQueryComplete method, let's add in itemList, get element zero. Call the setUrl method and give it the proper url, www.yahoo.com. Let's insert a new line and we'll call itemList, get element zero and we will call the setNotes method and we will pass in test notes2. Now let's call our updateItem method and we will pass in itemList, get element zero as our bookmark item, and we will also pass in null for our progress bar. And let's create a new…

Contents