mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 09:01:10 +00:00
Renames the image MIME resolver and organizes the MIME resolvers
Renames MimeTypes to ImageMimeTypes and moves it into Common/MimeTypes, updates the thumbnail endpoint and its tests, and aligns ThemeMimeTypes on the same frozen dictionary, initializer style and field naming.
This commit is contained in:
1 parent
1aa427b1e2
commit
4bcd37898c
5 files changed
+33
-32
No files matched your search
+6
-6
@@ -1,16 +1,16 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Presentation.Api.Common.Utilities;
|
||||
using Lumina.Presentation.Api.Common.MimeTypes;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Api.UnitTests.Common.Utilities;
|
||||
namespace Lumina.Presentation.Api.UnitTests.Common.MimeTypes;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="MimeTypes"/> class.
|
||||
/// Contains unit tests for the <see cref="ImageMimeTypes"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class MimeTypesTests
|
||||
public class ImageMimeTypesTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(ImageType.BMP, "image/bmp")] // bmp image type
|
||||
@@ -21,7 +21,7 @@ public class MimeTypesTests
|
||||
public void GetMimeType_WhenTypeIsKnown_ShouldReturnTheMappedMimeType(ImageType type, string expectedMimeType)
|
||||
{
|
||||
// Act
|
||||
string result = MimeTypes.GetMimeType(type);
|
||||
string result = ImageMimeTypes.GetMimeType(type);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(expectedMimeType, result);
|
||||
@@ -33,7 +33,7 @@ public class MimeTypesTests
|
||||
public void GetMimeType_WhenTypeIsUnknown_ShouldReturnOpaqueBinaryMimeType(ImageType type)
|
||||
{
|
||||
// Act
|
||||
string result = MimeTypes.GetMimeType(type);
|
||||
string result = ImageMimeTypes.GetMimeType(type);
|
||||
|
||||
// Assert
|
||||
Assert.Equal("application/octet-stream", result);
|
||||
+2
-2
@@ -7,7 +7,7 @@ using Lumina.Contracts.Fixtures.Core.Responses.FileSystemManagement.Thumbnails;
|
||||
using Lumina.Contracts.Requests.FileSystemManagement.Thumbnails;
|
||||
using Lumina.Contracts.Responses.FileSystemManagement.Thumbnails;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Presentation.Api.Common.Utilities;
|
||||
using Lumina.Presentation.Api.Common.MimeTypes;
|
||||
using Lumina.Presentation.Api.Core.Endpoints.FileSystemManagement.Thumbnails.GetThumbnail;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
@@ -56,7 +56,7 @@ public class GetThumbnailEndpointTests
|
||||
// Assert
|
||||
FileContentHttpResult fileResult = Assert.IsType<FileContentHttpResult>(result);
|
||||
Assert.Equal(expectedResponse.Bytes, fileResult.FileContents.ToArray());
|
||||
Assert.Equal(MimeTypes.GetMimeType(expectedResponse.Type), fileResult.ContentType);
|
||||
Assert.Equal(ImageMimeTypes.GetMimeType(expectedResponse.Type), fileResult.ContentType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in new issue
Block a user