diff --git a/tests/Jellyfin.Plugin.ListenBrainz.Api.Tests/ListenTests.cs b/tests/Jellyfin.Plugin.ListenBrainz.Api.Tests/JsonEncodeTests.cs similarity index 69% rename from tests/Jellyfin.Plugin.ListenBrainz.Api.Tests/ListenTests.cs rename to tests/Jellyfin.Plugin.ListenBrainz.Api.Tests/JsonEncodeTests.cs index 8ce98e64..40c36cfa 100644 --- a/tests/Jellyfin.Plugin.ListenBrainz.Api.Tests/ListenTests.cs +++ b/tests/Jellyfin.Plugin.ListenBrainz.Api.Tests/JsonEncodeTests.cs @@ -1,5 +1,7 @@ using System.Collections.ObjectModel; using Jellyfin.Plugin.ListenBrainz.Api.Models; +using Jellyfin.Plugin.ListenBrainz.Api.Models.Requests; +using Jellyfin.Plugin.ListenBrainz.Api.Resources; using Newtonsoft.Json; using Xunit; @@ -40,3 +42,20 @@ public void Listen_EncodeAndDecode() Assert.NotNull(deserializedListen); } } + +public class RecordingFeedbackTests +{ + [Theory] + [InlineData(FeedbackScore.Hated)] + [InlineData(FeedbackScore.Loved)] + [InlineData(FeedbackScore.Neutral)] + public void FeedbackValues_Encode(FeedbackScore score) + { + var request = new RecordingFeedbackRequest { Score = score }; + var actualJson = JsonConvert.SerializeObject(request, BaseClient.SerializerSettings); + Assert.NotNull(actualJson); + + var expectedJson = @"{""score"":" + (int)score + "}"; + Assert.Equal(expectedJson, actualJson); + } +}