diff options
Diffstat (limited to 'tests/Jellyfin.Extensions.Tests/Json/Models')
| -rw-r--r-- | tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyArrayModel.cs | 20 | ||||
| -rw-r--r-- | tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyIReadOnlyListModel.cs | 19 |
2 files changed, 39 insertions, 0 deletions
diff --git a/tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyArrayModel.cs b/tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyArrayModel.cs new file mode 100644 index 000000000..ef135278f --- /dev/null +++ b/tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyArrayModel.cs @@ -0,0 +1,20 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using Jellyfin.Extensions.Json.Converters; + +namespace Jellyfin.Extensions.Tests.Json.Models +{ + /// <summary> + /// The generic body model. + /// </summary> + /// <typeparam name="T">The value type.</typeparam> + public class GenericBodyArrayModel<T> + { + /// <summary> + /// Gets or sets the value. + /// </summary> + [SuppressMessage("Microsoft.Performance", "CA1819:Properties should not return arrays", MessageId = "Value", Justification = "Imported from ServiceStack")] + [JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))] + public T[] Value { get; set; } = default!; + } +} diff --git a/tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyIReadOnlyListModel.cs b/tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyIReadOnlyListModel.cs new file mode 100644 index 000000000..8e7b5a35b --- /dev/null +++ b/tests/Jellyfin.Extensions.Tests/Json/Models/GenericBodyIReadOnlyListModel.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; +using Jellyfin.Extensions.Json.Converters; + +namespace Jellyfin.Extensions.Tests.Json.Models +{ + /// <summary> + /// The generic body <c>IReadOnlyList</c> model. + /// </summary> + /// <typeparam name="T">The value type.</typeparam> + public class GenericBodyIReadOnlyListModel<T> + { + /// <summary> + /// Gets or sets the value. + /// </summary> + [JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))] + public IReadOnlyList<T> Value { get; set; } = default!; + } +} |
