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); }
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)); }