Skip to content

Commit

Permalink
Correct the names of several tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aannenko committed Jan 16, 2025
1 parent 6322cdd commit aed5971
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task DeleteTorrentByIdAsync_WhenGivenExistingId_DeletesTorrent()
}

[Test]
public async Task UpdateTorrentByIdAsync_WhenGivenNonExistingId_ReturnsNotFound()
public async Task UpdateTorrentByIdAsync_WhenGivenNonExistentId_ReturnsNotFound()
{
var response = await _client.DeleteAsync($"{TestData.Endpoints.Torrents}/-1").ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task FindTorrentByIdAsync_WhenGivenExistingTorrentId_ReturnsTorrent
}

[Test]
public async Task FindTorrentByIdAsync_WhenGivenNonExistingTorrentId_ReturnsNotFound()
public async Task FindTorrentByIdAsync_WhenGivenNonExistentTorrentId_ReturnsNotFound()
{
var response = await _client.GetAsync($"{TestData.Endpoints.Torrents}/999").ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public async Task FindTorrentPageAsync_WhenGivenCorrectHashStringFilter_ReturnsM
}

[Test]
public async Task FindTorrentPageAsync_WhenGivenNonExistingPaginationValues_ReturnsEmptyTorrentPage()
public async Task FindTorrentPageAsync_WhenGivenNonExistentPaginationValues_ReturnsEmptyTorrentPage()
{
var parameters = new FindTorrentPageParameters(Take: 5, AfterId: 100);

Expand All @@ -121,7 +121,7 @@ public async Task FindTorrentPageAsync_WhenGivenNonExistingPaginationValues_Retu
}

[Test]
public async Task FindTorrentPageAsync_WhenGivenNonExistingFilterValues_ReturnsEmptyTorrentPage()
public async Task FindTorrentPageAsync_WhenGivenNonExistentFilterValues_ReturnsEmptyTorrentPage()
{
var parameters = new FindTorrentPageParameters(PropertyStartsWith: "NoSuchTextAnywhere");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public async Task RefreshTorrentByIdAsync_WhenGivenExistingTorrentIdWithOutdated
}

[Test]
public async Task RefreshTorrentByIdAsync_WhenGivenExistingTorrentIdWithNonExistingHash_RefreshesTorrentAndReturns422()
public async Task RefreshTorrentByIdAsync_WhenGivenExistingTorrentIdWithNonExistentHash_RefreshesTorrentAndReturns422()
{
var response = await _client.PostAsync($"{TestData.Endpoints.Torrents}/3", null).ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task UpdateTorrentByIdAsync_WhenGivenExistingIdAndValidData_Updates
}

[Test]
public async Task UpdateTorrentByIdAsync_WhenGivenNonExistingId_ReturnsNotFound()
public async Task UpdateTorrentByIdAsync_WhenGivenNonExistentId_ReturnsNotFound()
{
var dto = new UpdateTorrentByIdRequest { DownloadDir = "/videos" };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public async Task TryUpdateOneByIdAsync_WhenGivenEmptyStringMagnetAndCron_SetsMa
}

[Test]
public async Task TryUpdateOneByIdAsync_WhenGivenNonExistingTorrentId_DoesNotUpdateTorrent()
public async Task TryUpdateOneByIdAsync_WhenGivenNonExistentTorrentId_DoesNotUpdateTorrent()
{
using var context = CreateContext();
var service = new TorrentService(context);
Expand Down Expand Up @@ -165,7 +165,7 @@ public async Task TryDeleteOneByIdAsync_WhenGivenExistingTorrentId_DeletesTorren
}

[Test]
public async Task TryDeleteOneByIdAsync_WhenGivenNonExistingTorrentId_DoesNotDeleteTorrent()
public async Task TryDeleteOneByIdAsync_WhenGivenNonExistentTorrentId_DoesNotDeleteTorrent()
{
using var context = CreateContext();
var service = new TorrentService(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public async Task FindOneByIdAsync_WhenGivenExistingTorrentId_ReturnsTorrent()
}

[Test]
public async Task FindOneByIdAsync_WhenGivenNonExistingTorrentId_ReturnsNull()
public async Task FindOneByIdAsync_WhenGivenNonExistentTorrentId_ReturnsNull()
{
using var context = CreateContext();
var service = new TorrentService(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void IndexOfStartOf_WhenGivenEmptySpanAndEmptyValue_ReturnsIndexOfValue()
Assert.That(""u8.IndexOfStartOf(""u8), Is.EqualTo(0));

[Test]
public void IndexOfStartOf_WhenGivenNormalSpanAndNonExistingValue_ReturnsMinusOne() =>
public void IndexOfStartOf_WhenGivenNormalSpanAndNonExistentValue_ReturnsMinusOne() =>
Assert.That("testing"u8.IndexOfStartOf("asdfg"u8), Is.EqualTo(-1));

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ public async Task FindMagnetUriAsync_WhenGivenWebPageWithoutMagnet_FindsMagnetUr
[Test]
public void FindMagnetUriAsync_WhenGivenNonExistentWebPage_ThrowsHttpRequestException()
{
var nonExistingAddress = new Uri("https://seemingly.valid.though.non.existent.address");
var NonExistentAddress = new Uri("https://seemingly.valid.though.non.existent.address");

using var httpClient = new HttpClient();
var client = new TorrentWebPageClient(_options, httpClient);

Assert.That(
async () => await client.FindMagnetUriAsync(nonExistingAddress).ConfigureAwait(false),
async () => await client.FindMagnetUriAsync(NonExistentAddress).ConfigureAwait(false),
Throws.TypeOf<HttpRequestException>());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public async Task GetTorrentsAsync_GetsAllTorrentsWithTwoFields_WhenTwoRequested
}

[Test]
public async Task GetTorrentsAsync_GetsAllTorrentsWithNoFields_WhenNonExistingRequestedFieldsProvided()
public async Task GetTorrentsAsync_GetsAllTorrentsWithNoFields_WhenNonExistentRequestedFieldsProvided()
{
const string expectedRequest = """{"method":"torrent-get","arguments":{"fields":[998,999]}}""";

Expand Down Expand Up @@ -159,7 +159,7 @@ public async Task GetTorrentsAsync_GetsAllTorrentsWithNoFields_WhenEmptyRequeste
}

[Test]
public async Task GetTorrentsAsync_GetsNoTorrents_WhenNonExistingHashstringProvided()
public async Task GetTorrentsAsync_GetsNoTorrents_WhenNonExistentHashstringProvided()
{
const string expectedRequest =
"""{"method":"torrent-get","arguments":{"fields":[],"ids":["0bda511316a069e86dd8ee8a3610475d2013a7fb"]}}""";
Expand Down

0 comments on commit aed5971

Please sign in to comment.