Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public async Task DeleteArticleAsync(PocketItem pocketItem)
        {
            await _pocketClient.DeletePocketItemAsync(pocketItem);

            await SyncArticlesAsync();
        }
Exemplo n.º 3
0
        private async Task TestDeleteAsync(PocketItem pocketItem)
        {
            bool result = await _pocketClient.DeletePocketItemAsync(pocketItem);

            Assert.AreEqual(true, result);
        }