mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 05:18:27 +01:00
Merge pull request #7101 from Bond-009/imagejpg
Remove incorrect mime type image/jpg
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using Xunit;
|
||||
|
||||
namespace Jellyfin.Model.Drawing;
|
||||
|
||||
public static class ImageFormatExtensionsTests
|
||||
{
|
||||
private static TheoryData<ImageFormat> GetAllImageFormats()
|
||||
{
|
||||
var theoryTypes = new TheoryData<ImageFormat>();
|
||||
foreach (var x in Enum.GetValues<ImageFormat>())
|
||||
{
|
||||
theoryTypes.Add(x);
|
||||
}
|
||||
|
||||
return theoryTypes;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(GetAllImageFormats))]
|
||||
public static void GetMimeType_Valid_Valid(ImageFormat format)
|
||||
=> Assert.Null(Record.Exception(() => format.GetMimeType()));
|
||||
|
||||
[Theory]
|
||||
[InlineData((ImageFormat)int.MinValue)]
|
||||
[InlineData((ImageFormat)int.MaxValue)]
|
||||
[InlineData((ImageFormat)(-1))]
|
||||
[InlineData((ImageFormat)5)]
|
||||
public static void GetMimeType_Valid_ThrowsInvalidEnumArgumentException(ImageFormat format)
|
||||
=> Assert.Throws<InvalidEnumArgumentException>(() => format.GetMimeType());
|
||||
}
|
||||
@@ -124,7 +124,6 @@ namespace Jellyfin.Model.Tests.Net
|
||||
[InlineData("font/woff2", ".woff2")]
|
||||
[InlineData("image/bmp", ".bmp")]
|
||||
[InlineData("image/gif", ".gif")]
|
||||
[InlineData("image/jpg", ".jpg")]
|
||||
[InlineData("image/jpeg", ".jpg")]
|
||||
[InlineData("image/png", ".png")]
|
||||
[InlineData("image/svg+xml", ".svg")]
|
||||
|
||||
Reference in New Issue
Block a user