diff --git a/src/Tests/TransmissionManager.TorrentWebPages.Tests/TorrentWebPageServiceTests.cs b/src/Tests/TransmissionManager.TorrentWebPages.Tests/TorrentWebPageClientTests.cs similarity index 65% rename from src/Tests/TransmissionManager.TorrentWebPages.Tests/TorrentWebPageServiceTests.cs rename to src/Tests/TransmissionManager.TorrentWebPages.Tests/TorrentWebPageClientTests.cs index 24e938d..5a45d74 100644 --- a/src/Tests/TransmissionManager.TorrentWebPages.Tests/TorrentWebPageServiceTests.cs +++ b/src/Tests/TransmissionManager.TorrentWebPages.Tests/TorrentWebPageClientTests.cs @@ -7,40 +7,9 @@ namespace TransmissionManager.TorrentWebPages.Tests; [Parallelizable(ParallelScope.Self)] -public sealed class TorrentWebPageServiceTests +public sealed class TorrentWebPageClientTests { private const string _webPageUri = "https://torrentTracker.com/forum/viewtopic.php?t=1234567"; - private const string _magnetUri = "magnet:?xt=urn:btih:EXAMPLEHASH&dn=Example+Name"; - private const string _webPageContentWithMagnet = $""" - - - - - - Magnet Link Example - - -

Magnet Link Example

-

Click the link below to open the Magnet URI:

- Download via Magnet - - - """; - - private const string _webPageContentWithoutMagnet = $""" - - - - - - Magnet Link Example - - -

Magnet Link Example

-

No Magnet URI for you today :(

- - - """; private static readonly FakeOptionsMonitor _options = new(new() { @@ -52,6 +21,23 @@ public sealed class TorrentWebPageServiceTests [Test] public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenProperWebPage() { + const string _magnetUri = "magnet:?xt=urn:btih:EXAMPLEHASH&dn=Example+Name"; + const string _webPageContentWithMagnet = $""" + + + + + + Magnet Link Example + + +

Magnet Link Example

+

Click the link below to open the Magnet URI:

+ Download via Magnet + + + """; + var service = CreateClient( new(HttpMethod.Get, new(_webPageUri)), new(HttpStatusCode.OK, Content: _webPageContentWithMagnet)); @@ -64,6 +50,21 @@ public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenProperWebPage() [Test] public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenWebPageWithoutMagnet() { + const string _webPageContentWithoutMagnet = $""" + + + + + + Magnet Link Example + + +

Magnet Link Example

+

No Magnet URI for you today :(

+ + + """; + var service = CreateClient( new(HttpMethod.Get, new(_webPageUri)), new(HttpStatusCode.OK, Content: _webPageContentWithoutMagnet));