added lidarr client null body tests

This commit is contained in:
Flaminel committed 2026-10-27 10:36:41 +02:00
1 parent 0ce1b5b9ac
commit 043212712d
1 file changed
+52
@@ -324,6 +324,19 @@ public class LidarrClientTests
request.RequestUri!.AbsolutePath.ShouldBe("/api/v1/tag");
}
[Fact]
public async Task GetAllTagsAsync_NullBody_ReturnsEmpty()
{
// Arrange
_httpMessageHandler.SetupResponse((_, _) => Task.FromResult(JsonNullResponse()));
// Act
List<Tag> tags = await _client.GetAllTagsAsync(_arrInstance);
// Assert
tags.ShouldBeEmpty();
}
#endregion
#region StreamAllArtistsAsync / GetQualityProfilesAsync
@@ -397,6 +410,19 @@ public class LidarrClientTests
request.RequestUri!.AbsolutePath.ShouldBe("/api/v1/qualityprofile");
}
[Fact]
public async Task GetQualityProfilesAsync_NullBody_ReturnsEmpty()
{
// Arrange
_httpMessageHandler.SetupResponse((_, _) => Task.FromResult(JsonNullResponse()));
// Act
List<ArrQualityProfile> profiles = await _client.GetQualityProfilesAsync(_arrInstance);
// Assert
profiles.ShouldBeEmpty();
}
#endregion
#region GetAlbumsAsync / GetTrackFilesAsync
@@ -432,6 +458,19 @@ public class LidarrClientTests
albums[1].Statistics.ShouldBeNull();
}
[Fact]
public async Task GetAlbumsAsync_NullBody_ReturnsEmpty()
{
// Arrange
_httpMessageHandler.SetupResponse((_, _) => Task.FromResult(JsonNullResponse()));
// Act
List<SearchableAlbum> albums = await _client.GetAlbumsAsync(_arrInstance, 7);
// Assert
albums.ShouldBeEmpty();
}
[Fact]
public async Task GetTrackFilesAsync_BuildsArtistQueryAndDeserializesScores()
{
@@ -454,6 +493,19 @@ public class LidarrClientTests
file.CustomFormatScore.ShouldBe(-5);
}
[Fact]
public async Task GetTrackFilesAsync_NullBody_ReturnsEmpty()
{
// Arrange
_httpMessageHandler.SetupResponse((_, _) => Task.FromResult(JsonNullResponse()));
// Act
List<ArrTrackFile> files = await _client.GetTrackFilesAsync(_arrInstance, 7);
// Assert
files.ShouldBeEmpty();
}
#endregion
#region GetRecentlyGrabbedAlbumIdsAsync