Beispiel #1
0
        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));
        }
Beispiel #2
0
        public void AutoSelectPieceLength()
        {
            var torrentCreator = new TestTorrentCreator();

            Assert.DoesNotThrowAsync(() => torrentCreator.CreateAsync("name", files, CancellationToken.None));
        }