示例#1
0
        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);
        }
示例#2
0
        public async Task DeleteArticleAsync(PocketItem pocketItem)
        {
            await _pocketClient.DeletePocketItemAsync(pocketItem);

            await SyncArticlesAsync();
        }
示例#3
0
        private async Task TestDeleteAsync(PocketItem pocketItem)
        {
            bool result = await _pocketClient.DeletePocketItemAsync(pocketItem);

            Assert.AreEqual(true, result);
        }