public void AsyncCancel() { var cts = new CancellationTokenSource(); cts.Cancel(); var fileSource = new TorrentFileSource(typeof(TorrentCreatorTests).Assembly.Location); Assert.ThrowsAsync <OperationCanceledException> (() => creator.CreateAsync(fileSource, cts.Token)); }
public void AutoSelectPieceLength() { var torrentCreator = new TorrentCreator(TestFactories); Assert.DoesNotThrowAsync(() => torrentCreator.CreateAsync("name", files, CancellationToken.None)); }