public async Task TestAddArticleAsync() { PocketCache pocketCache = new PocketCache(pocketClient); await pocketCache.SyncArticlesAsync(); if (pocketCache.PocketItems.Any(pi => pi.GivenUrl == testArticleUrl)) { await pocketClient.DeletePocketItemAsync(pocketCache.PocketItems.First(pi => pi.GivenUrl == testArticleUrl)); } int articleCountStart = pocketCache.PocketItems.Count; await pocketCache.AddArticleAsync(new Uri(testArticleUrl)); int articleCountEnd = pocketCache.PocketItems.Count; Assert.AreNotEqual(articleCountStart, articleCountEnd); Assert.IsTrue(articleCountEnd > articleCountStart); Assert.IsTrue(articleCountEnd == articleCountStart + 1); }
public async Task DeleteArticleAsync(PocketItem pocketItem) { await _pocketClient.DeletePocketItemAsync(pocketItem); await SyncArticlesAsync(); }
private async Task TestDeleteAsync(PocketItem pocketItem) { bool result = await _pocketClient.DeletePocketItemAsync(pocketItem); Assert.AreEqual(true, result); }