Пример #1
0
        public async Task Resolve_Success(string url, int expectedId)
        {
            var resolved = await LinkResolver.ResolveAsync(new Uri(url));

            Assert.NotNull(resolved);
            Assert.AreEqual(expectedId, resolved !.ID);
        }
Пример #2
0
        public void ResolveHash_Cancellation(string url)
        {
            using var tokenSource = new CancellationTokenSource();
            tokenSource.CancelAfter(BooruHelper.TaskCancellationDelay);

            Assert.ThrowsAsync <TaskCanceledException>(() => LinkResolver.ResolveAsync(new Uri(url), tokenSource.Token));
        }