mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Routes the file browser thumbnail requests through the authenticated Web proxy
This commit is contained in:
1 parent
a32f80337b
commit
f694882b46
15 files changed
+299
-35
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Thumbnails;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.FileSystemManagement.Thumbnails;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for generating <see cref="GetThumbnailRequest"/> test data.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetThumbnailRequestFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="GetThumbnailRequest"/> instance with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="path">Optional file system path of the file whose thumbnail is retrieved.</param>
|
||||
/// <param name="quality">Optional quality used for the thumbnail.</param>
|
||||
/// <returns>A configured <see cref="GetThumbnailRequest"/> instance.</returns>
|
||||
public GetThumbnailRequest Create(string? path = null, int? quality = null)
|
||||
{
|
||||
return new GetThumbnailRequest(
|
||||
Path: path ?? $"/media/{System.Guid.NewGuid():N}.png",
|
||||
Quality: quality ?? 70
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates multiple <see cref="GetThumbnailRequest"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="GetThumbnailRequest"/> instances.</returns>
|
||||
public List<GetThumbnailRequest> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user