public async Task QueryNotebookTest() { UserContentProvider mine = new UserContentProvider(); LoginResult result = await mine.Login(Config.username, Config.password); List<NotebookResult> nr = await mine.QueryNotebook(0, result.Id.ToString(), result.MobileToken); Assert.IsNotNull(nr); }
private async Task QueryOwnerCollection() { if(notebookPage == 1) { if(OwnNotebooks == null) { OwnNotebooks = new ObservableCollection<NotebookResult>(); } else { OwnNotebooks.Clear(); } } UserContentProvider user = new UserContentProvider(); List<NotebookResult> result; if(currentUserId == GlobalValue.CurrentUserContext.UserId) { result = await user.QueryNotebook(notebookPage, GlobalValue.CurrentUserContext.UserId, GlobalValue.CurrentUserContext.MobileToken); } else { result = await user.QueryOhterNotebook(currentUserId, notebookPage, GlobalValue.CurrentUserContext.UserId, GlobalValue.CurrentUserContext.MobileToken); } result.ForEach(x => OwnNotebooks.Add(x)); notebookPage++; if (OwnNotebooks.Count <= 10 && notebookPage == 2) { await QueryOwnerCollection(); } }