Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aannenko committed Sep 17, 2024
1 parent ee0cbb0 commit 9223155
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public sealed class TorrentWebPageClientTests
[Test]
public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenProperWebPage()
{
const string _magnetUri = "magnet:?xt=urn:btih:EXAMPLEHASH&dn=Example+Name";
const string _webPageContentWithMagnet = $"""
const string magnetUri = "magnet:?xt=urn:btih:EXAMPLEHASH&dn=Example+Name";
const string webPageContentWithMagnet = $"""
<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -33,24 +33,24 @@ public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenProperWebPage()
<body>
<h1>Magnet Link Example</h1>
<p>Click the link below to open the Magnet URI:</p>
<a href="{_magnetUri}">Download via Magnet</a>
<a href="{magnetUri}">Download via Magnet</a>
</body>
</html>
""";

var client = CreateClient(
new(HttpMethod.Get, new(_webPageUri)),
new(HttpStatusCode.OK, Content: _webPageContentWithMagnet));
new(HttpStatusCode.OK, Content: webPageContentWithMagnet));

var result = await client.FindMagnetUriAsync(_webPageUri);

Assert.That(result, Is.EqualTo(_magnetUri));
Assert.That(result, Is.EqualTo(magnetUri));
}

[Test]
public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenWebPageWithoutMagnet()
{
const string _webPageContentWithoutMagnet = $"""
const string webPageContentWithoutMagnet = """
<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -67,7 +67,7 @@ public async Task FindMagnetUriAsync_FindsMagnetUri_IfGivenWebPageWithoutMagnet(

var client = CreateClient(
new(HttpMethod.Get, new(_webPageUri)),
new(HttpStatusCode.OK, Content: _webPageContentWithoutMagnet));
new(HttpStatusCode.OK, Content: webPageContentWithoutMagnet));

var result = await client.FindMagnetUriAsync(_webPageUri);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ namespace TransmissionManager.Transmission.Serialization;
[JsonSerializable(typeof(TransmissionTorrentGetResponse))]
[JsonSerializable(typeof(TransmissionTorrentAddRequest))]
[JsonSerializable(typeof(TransmissionTorrentAddResponse))]
internal partial class TransmissionJsonSerializerContext : JsonSerializerContext
{
}
public partial class TransmissionJsonSerializerContext : JsonSerializerContext;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace TransmissionManager.Transmission.Services;

public sealed class SessionHeaderHandler(SessionHeaderProvider headerProvider)
: DelegatingHandler
public sealed class SessionHeaderHandler(SessionHeaderProvider headerProvider) : DelegatingHandler
{
protected override async Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
Expand Down

0 comments on commit 9223155

Please sign in to comment.