Skip to content

Commit

Permalink
[core] Double check magnetlinks can't be added twice
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcgovern committed Jan 24, 2022
1 parent f43f136 commit 4deac15
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/MonoTorrent.Tests/Client/ClientEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ public void DownloadMetadata_Cancelled ()
Assert.ThrowsAsync<OperationCanceledException> (() => task);
}

[Test]
public void DownloadMagnetLink_SameTwice ()
{
var link = MagnetLink.Parse ("magnet:?xt=urn:btih:1234512345123451234512345123451234512345");
using var engine = new ClientEngine (EngineSettingsBuilder.CreateForTests ());
var first = engine.AddAsync (link, "");
Assert.ThrowsAsync<TorrentException> (() => engine.AddAsync (link, ""));
}

[Test]
public void DownloadMetadata_SameTwice ()
{
Expand Down

0 comments on commit 4deac15

Please sign in to comment.