mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
Standardizes test projects against conventions
This commit is contained in:
1 parent
59e16d645a
commit
ced1f778c4
78 files changed
+283
-201
No files matched your search
+16
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
@@ -222,6 +222,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Infrastructure.Fixtu
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Presentation.Api.Fixtures", "..\tests\Common\Lumina.Presentation.Api.Fixtures\Lumina.Presentation.Api.Fixtures.csproj", "{4E7353D5-5F1C-43A1-B792-6CD1D5DBDB91}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Domain.SharedKernel.Fixtures", "..\tests\Common\Lumina.Domain.SharedKernel.Fixtures\Lumina.Domain.SharedKernel.Fixtures.csproj", "{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -504,6 +506,18 @@ Global
|
||||
{4E7353D5-5F1C-43A1-B792-6CD1D5DBDB91}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4E7353D5-5F1C-43A1-B792-6CD1D5DBDB91}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{4E7353D5-5F1C-43A1-B792-6CD1D5DBDB91}.Release|x86.Build.0 = Release|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Release|x64.Build.0 = Release|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -556,6 +570,7 @@ Global
|
||||
{BEF177F3-99E7-4649-86AB-B4235B9A95ED} = {7E8A2D6B-3F4C-4E5F-9A6B-1C2D3E4F5A6B}
|
||||
{7C2AB7E7-F58B-4F96-BDFB-05E403BD999B} = {7E8A2D6B-3F4C-4E5F-9A6B-1C2D3E4F5A6B}
|
||||
{4E7353D5-5F1C-43A1-B792-6CD1D5DBDB91} = {7E8A2D6B-3F4C-4E5F-9A6B-1C2D3E4F5A6B}
|
||||
{A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61} = {7E8A2D6B-3F4C-4E5F-9A6B-1C2D3E4F5A6B}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4A55A28E-C657-4A0B-95EA-2931AE66004E}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ using System.IO;
|
||||
using Xunit;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.Fixtures.Common.Enums.PhotoLibrary;
|
||||
namespace Lumina.Domain.SharedKernel.Fixtures.Common.Enums.PhotoLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Test-support class providing image byte data for each supported <see cref="ImageType"/>.
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>$(SolutionDir)..\bin\api\</BaseOutputPath>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>false</IsTestProject>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Lumina.Domain.SharedKernel\Lumina.Domain.SharedKernel.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("Lumina.Domain.SharedKernel.Fixtures")]
|
||||
[assembly: AssemblyProduct("Lumina.Domain.SharedKernel.Fixtures")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("A6BC3F8B-CAB8-4F3B-BD89-B7428697DE61")]
|
||||
|
||||
[assembly: InternalsVisibleTo("Lumina.Domain.UnitTests")]
|
||||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
||||
+3
-3
@@ -54,7 +54,7 @@ public class GetPermissionsEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnPermissions()
|
||||
public async Task GetPermissions_WhenCalledWithValidRequest_ShouldReturnPermissions()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/auth/permissions");
|
||||
@@ -76,7 +76,7 @@ public class GetPermissionsEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetPermissions_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Act
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync(); // authenticated user, but not admin
|
||||
@@ -99,7 +99,7 @@ public class GetPermissionsEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetPermissions_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -58,7 +58,7 @@ public class AddRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldCreateRole()
|
||||
public async Task AddRole_WhenCalledWithValidRequest_ShouldCreateRole()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -91,7 +91,7 @@ public class AddRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task AddRole_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -119,7 +119,7 @@ public class AddRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRoleAlreadyExists_ShouldReturnConflict()
|
||||
public async Task AddRole_WhenRoleAlreadyExists_ShouldReturnConflict()
|
||||
{
|
||||
// Arrange
|
||||
AddRoleRequest request = new(
|
||||
@@ -146,7 +146,7 @@ public class AddRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task AddRole_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+5
-5
@@ -53,7 +53,7 @@ public class DeleteRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldDeleteRole()
|
||||
public async Task DeleteRole_WhenCalledWithValidRequest_ShouldDeleteRole()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -82,7 +82,7 @@ public class DeleteRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task DeleteRole_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -107,7 +107,7 @@ public class DeleteRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenTryingToDeleteAdminRole_ShouldReturnForbiddenResult()
|
||||
public async Task DeleteRole_WhenTryingToDeleteAdminRole_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -134,7 +134,7 @@ public class DeleteRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRoleDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task DeleteRole_WhenRoleDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentRoleId = Guid.NewGuid();
|
||||
@@ -158,7 +158,7 @@ public class DeleteRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task DeleteRole_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -56,7 +56,7 @@ public class GetRolePermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnRolePermissions()
|
||||
public async Task GetRolePermissions_WhenCalledWithValidRequest_ShouldReturnRolePermissions()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -86,7 +86,7 @@ public class GetRolePermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetRolePermissions_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync(); // authenticated user, but not admin
|
||||
@@ -114,7 +114,7 @@ public class GetRolePermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidRoleId_ShouldReturnNotFound()
|
||||
public async Task GetRolePermissions_WhenCalledWithInvalidRoleId_ShouldReturnNotFound()
|
||||
{
|
||||
// Act
|
||||
Guid invalidRoleId = Guid.NewGuid();
|
||||
@@ -136,7 +136,7 @@ public class GetRolePermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetRolePermissions_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public class GetRolesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnRoles()
|
||||
public async Task GetRoles_WhenCalledWithValidRequest_ShouldReturnRoles()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/auth/roles");
|
||||
@@ -74,7 +74,7 @@ public class GetRolesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetRoles_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -98,7 +98,7 @@ public class GetRolesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetRoles_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -58,7 +58,7 @@ public class UpdateRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldUpdateRole()
|
||||
public async Task UpdateRole_WhenCalledWithValidRequest_ShouldUpdateRole()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -103,7 +103,7 @@ public class UpdateRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task UpdateRole_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -132,7 +132,7 @@ public class UpdateRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRoleDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task UpdateRole_WhenRoleDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentRoleId = Guid.NewGuid();
|
||||
@@ -161,7 +161,7 @@ public class UpdateRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task UpdateRole_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -123,7 +123,7 @@ public class GetDirectoriesEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
public async Task GetDirectories_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -149,7 +149,7 @@ public class GetDirectoriesEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetDirectories_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string emptyPath = "";
|
||||
@@ -180,7 +180,7 @@ public class GetDirectoriesEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetDirectories_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
@@ -196,7 +196,7 @@ public class GetDirectoriesEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetDirectories_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public class GetDrivesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactor
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalled_ShouldReturnDrives()
|
||||
public async Task GetDrives_WhenCalled_ShouldReturnDrives()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync($"/api/v1/drives/get-drives");
|
||||
|
||||
+3
-3
@@ -48,7 +48,7 @@ public class GetTypeEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalled_ShouldReturnOkResultWithFileSystemTypeResponse()
|
||||
public async Task GetType_WhenCalled_ShouldReturnOkResultWithFileSystemTypeResponse()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/file-system/get-type");
|
||||
@@ -62,7 +62,7 @@ public class GetTypeEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledMultipleTimes_ShouldReturnConsistentResults()
|
||||
public async Task GetType_WhenCalledMultipleTimes_ShouldReturnConsistentResults()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response1 = await _client.GetAsync("/api/v1/file-system/get-type");
|
||||
@@ -84,7 +84,7 @@ public class GetTypeEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetType_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
|
||||
|
||||
+7
-7
@@ -53,7 +53,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[SkipWhenHiddenAttributeNotSupportedFact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndNotIncludeHiddenElements_ShouldReturnFilesWithoutHiddenElements()
|
||||
public async Task GetFiles_WhenCalledWithValidPathAndNotIncludeHiddenElements_ShouldReturnFilesWithoutHiddenElements()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemStructureFixture fileSystemFixture = new();
|
||||
@@ -90,7 +90,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[SkipWhenHiddenAttributeNotSupportedFact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndHiddenChildrenAndNotIncludeHiddenElements_ShouldReturnNoFiles()
|
||||
public async Task GetFiles_WhenCalledWithValidPathAndHiddenChildrenAndNotIncludeHiddenElements_ShouldReturnNoFiles()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemStructureFixture fileSystemFixture = new();
|
||||
@@ -122,7 +122,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndWithIncludeHiddenElements_ShouldReturnFilesWithHiddenElements()
|
||||
public async Task GetFiles_WhenCalledWithValidPathAndWithIncludeHiddenElements_ShouldReturnFilesWithHiddenElements()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemStructureFixture fileSystemFixture = new();
|
||||
@@ -163,7 +163,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
public async Task GetFiles_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -189,7 +189,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetFiles_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string emptyPath = "";
|
||||
@@ -220,7 +220,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetFiles_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
@@ -236,7 +236,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetFiles_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
|
||||
+7
-7
@@ -53,7 +53,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[SkipWhenHiddenAttributeNotSupportedFact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndNotIncludeHiddenElements_ShouldReturnTreeFilesWithoutHiddenElements()
|
||||
public async Task GetTreeFiles_WhenCalledWithValidPathAndNotIncludeHiddenElements_ShouldReturnTreeFilesWithoutHiddenElements()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemStructureFixture fileSystemFixture = new();
|
||||
@@ -90,7 +90,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[SkipWhenHiddenAttributeNotSupportedFact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndHiddenChildrenAndNotIncludeHiddenElements_ShouldReturnNoTreeFiles()
|
||||
public async Task GetTreeFiles_WhenCalledWithValidPathAndHiddenChildrenAndNotIncludeHiddenElements_ShouldReturnNoTreeFiles()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemStructureFixture fileSystemFixture = new();
|
||||
@@ -123,7 +123,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndWithIncludeHiddenElements_ShouldReturnTreeFilesWithHiddenElements()
|
||||
public async Task GetTreeFiles_WhenCalledWithValidPathAndWithIncludeHiddenElements_ShouldReturnTreeFilesWithHiddenElements()
|
||||
{
|
||||
// Arrange
|
||||
FileSystemStructureFixture fileSystemFixture = new();
|
||||
@@ -163,7 +163,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
}
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
public async Task GetTreeFiles_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -189,7 +189,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetTreeFiles_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string emptyPath = "";
|
||||
@@ -220,7 +220,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetTreeFiles_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
@@ -236,7 +236,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetTreeFiles_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
|
||||
+5
-5
@@ -49,7 +49,7 @@ public class CheckPathExistsEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithExistingPath_ShouldReturnOkResultWithExistsTrue()
|
||||
public async Task CheckPathExists_WhenCalledWithExistingPath_ShouldReturnOkResultWithExistsTrue()
|
||||
{
|
||||
// Arrange
|
||||
string tempPath = System.IO.Path.GetTempPath();
|
||||
@@ -66,7 +66,7 @@ public class CheckPathExistsEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonExistingPath_ShouldReturnOkResultWithExistsFalse()
|
||||
public async Task CheckPathExists_WhenCalledWithNonExistingPath_ShouldReturnOkResultWithExistsFalse()
|
||||
{
|
||||
// Arrange
|
||||
string nonExistingPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), Guid.NewGuid().ToString());
|
||||
@@ -83,7 +83,7 @@ public class CheckPathExistsEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task CheckPathExists_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string path = "";
|
||||
@@ -111,7 +111,7 @@ public class CheckPathExistsEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnOkResultWithExistsFalse()
|
||||
public async Task CheckPathExists_WhenCalledWithInvalidPath_ShouldReturnOkResultWithExistsFalse()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -128,7 +128,7 @@ public class CheckPathExistsEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task CheckPathExists_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.GetTempPath();
|
||||
|
||||
+4
-4
@@ -49,7 +49,7 @@ public class CombinePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPaths_ShouldReturnOkResultWithCombinedPath()
|
||||
public async Task CombinePath_WhenCalledWithValidPaths_ShouldReturnOkResultWithCombinedPath()
|
||||
{
|
||||
// Arrange
|
||||
string originalPath = System.IO.Path.GetTempPath();
|
||||
@@ -70,7 +70,7 @@ public class CombinePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPaths_ShouldReturnValidationProblemResult()
|
||||
public async Task CombinePath_WhenCalledWithEmptyPaths_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string originalPath = "";
|
||||
@@ -100,7 +100,7 @@ public class CombinePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task CombinePath_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
string originalPath = "/home/user";
|
||||
@@ -115,7 +115,7 @@ public class CombinePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task CombinePath_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string originalPath = System.IO.Path.GetTempPath();
|
||||
|
||||
+6
-6
@@ -52,7 +52,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPath_ShouldReturnOkResultWithPathSegmentResponses()
|
||||
public async Task GetPathParent_WhenCalledWithValidPath_ShouldReturnOkResultWithPathSegmentResponses()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory", "testFile.txt");
|
||||
@@ -87,7 +87,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithRootPath_ShouldReturnForbiddenResult()
|
||||
public async Task GetPathParent_WhenCalledWithRootPath_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
string rootPath = System.IO.Path.GetPathRoot(System.IO.Path.GetTempPath())!;
|
||||
@@ -112,7 +112,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetPathParent_WhenCalledWithInvalidPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -141,7 +141,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetPathParent_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string emptyPath = "";
|
||||
@@ -171,7 +171,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetPathParent_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
@@ -186,7 +186,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetPathParent_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
|
||||
+5
-5
@@ -49,7 +49,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPath_ShouldReturnOkResultWithPathSegmentResponse()
|
||||
public async Task GetPathRoot_WhenCalledWithValidPath_ShouldReturnOkResultWithPathSegmentResponse()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.GetTempPath();
|
||||
@@ -68,7 +68,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetPathRoot_WhenCalledWithInvalidPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -98,7 +98,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetPathRoot_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string emptyPath = "";
|
||||
@@ -128,7 +128,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetPathRoot_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.GetTempPath();
|
||||
@@ -143,7 +143,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetPathRoot_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.GetTempPath();
|
||||
|
||||
+4
-4
@@ -47,7 +47,7 @@ public class GetPathSeparatorEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalled_ShouldReturnOkResultWithPathSeparatorResponse()
|
||||
public async Task GetPathSeparator_WhenCalled_ShouldReturnOkResultWithPathSeparatorResponse()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/path/get-path-separator");
|
||||
@@ -61,7 +61,7 @@ public class GetPathSeparatorEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledMultipleTimes_ShouldReturnConsistentResults()
|
||||
public async Task GetPathSeparator_WhenCalledMultipleTimes_ShouldReturnConsistentResults()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response1 = await _client.GetAsync("/api/v1/path/get-path-separator");
|
||||
@@ -83,7 +83,7 @@ public class GetPathSeparatorEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetPathSeparator_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
|
||||
@@ -96,7 +96,7 @@ public class GetPathSeparatorEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetPathSeparator_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -50,7 +50,7 @@ public class SplitPathEndpointTests : IClassFixture<AuthenticatedLuminaApiFactor
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPath_ShouldReturnOkResultWithSplitSegments()
|
||||
public async Task SplitPath_WhenCalledWithValidPath_ShouldReturnOkResultWithSplitSegments()
|
||||
{
|
||||
// Arrange
|
||||
string tempPath = System.IO.Path.GetTempPath();
|
||||
@@ -72,7 +72,7 @@ public class SplitPathEndpointTests : IClassFixture<AuthenticatedLuminaApiFactor
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task SplitPath_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string path = "";
|
||||
@@ -101,7 +101,7 @@ public class SplitPathEndpointTests : IClassFixture<AuthenticatedLuminaApiFactor
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnProblemDetails()
|
||||
public async Task SplitPath_WhenCalledWithInvalidPath_ShouldReturnProblemDetails()
|
||||
{
|
||||
// Arrange
|
||||
string path = "invalid:path";
|
||||
@@ -130,7 +130,7 @@ public class SplitPathEndpointTests : IClassFixture<AuthenticatedLuminaApiFactor
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task SplitPath_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
|
||||
+4
-4
@@ -49,7 +49,7 @@ public class ValidatePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPath_ShouldReturnOkResultWithIsValidTrue()
|
||||
public async Task ValidatePath_WhenCalledWithValidPath_ShouldReturnOkResultWithIsValidTrue()
|
||||
{
|
||||
// Arrange
|
||||
string tempPath = System.IO.Path.GetTempPath();
|
||||
@@ -67,7 +67,7 @@ public class ValidatePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnOkResultWithIsValidFalse()
|
||||
public async Task ValidatePath_WhenCalledWithInvalidPath_ShouldReturnOkResultWithIsValidFalse()
|
||||
{
|
||||
// Arrange
|
||||
string invalidPath = "invalid:path";
|
||||
@@ -84,7 +84,7 @@ public class ValidatePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task ValidatePath_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string path = "";
|
||||
@@ -113,7 +113,7 @@ public class ValidatePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task ValidatePath_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
|
||||
|
||||
+5
-5
@@ -52,7 +52,7 @@ public class GetThumbnailEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidPathAndQuality_ShouldReturnOkResultWithThumbnail()
|
||||
public async Task GetThumbnail_WhenCalledWithValidPathAndQuality_ShouldReturnOkResultWithThumbnail()
|
||||
{
|
||||
// Arrange
|
||||
int quality = 80;
|
||||
@@ -68,7 +68,7 @@ public class GetThumbnailEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
public async Task GetThumbnail_WhenCalledWithInvalidPath_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidImagePath = "/path/to/nonexistent/image.jpg";
|
||||
@@ -93,7 +93,7 @@ public class GetThumbnailEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
public async Task GetThumbnail_WhenCalledWithEmptyPath_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
string invalidImagePath = "";
|
||||
@@ -123,7 +123,7 @@ public class GetThumbnailEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidQuality_ShouldReturnValidationProblemResult()
|
||||
public async Task GetThumbnail_WhenCalledWithInvalidQuality_ShouldReturnValidationProblemResult()
|
||||
{
|
||||
// Arrange
|
||||
int invalidQuality = -1;
|
||||
@@ -152,7 +152,7 @@ public class GetThumbnailEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetThumbnail_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
int quality = 80;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Api.IntegrationTests.Core.Endpoints.WrittenContentLibrary.BookLibrary.Books;
|
||||
namespace Lumina.Presentation.Api.IntegrationTests.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.AddBook;
|
||||
|
||||
/// <summary>
|
||||
/// Contains integration tests for the <see cref="AddBookEndpoint"/> class.
|
||||
+3
-3
@@ -13,7 +13,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Api.IntegrationTests.Core.Endpoints.WrittenContentLibrary.BookLibrary.Books;
|
||||
namespace Lumina.Presentation.Api.IntegrationTests.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.GetBooks;
|
||||
|
||||
/// <summary>
|
||||
/// Contains integration tests for the <see cref="GetBooksEndpoint"/> class.
|
||||
@@ -65,7 +65,7 @@ public class GetBooksEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
public async Task GetBooks_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
|
||||
@@ -78,7 +78,7 @@ public class GetBooksEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
public async Task GetBooks_WhenCancellationTokenIsCanceled_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
+12
-3
@@ -53,8 +53,16 @@ public class CheckInitializationEndpointTests : IClassFixture<AuthenticatedLumin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenNoUsersExist_ShouldReturnNotInitialized()
|
||||
public async Task CheckInitialization_WhenNoUsersExist_ShouldReturnNotInitialized()
|
||||
{
|
||||
// Arrange
|
||||
using (IServiceScope scope = _apiFactory.Services.CreateScope())
|
||||
{
|
||||
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
|
||||
dbContext.Users.RemoveRange(dbContext.Users);
|
||||
await dbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/initialization");
|
||||
|
||||
@@ -70,7 +78,7 @@ public class CheckInitializationEndpointTests : IClassFixture<AuthenticatedLumin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUsersExist_ShouldReturnInitialized()
|
||||
public async Task CheckInitialization_WhenUsersExist_ShouldReturnInitialized()
|
||||
{
|
||||
// Arrange
|
||||
await CreateTestUser();
|
||||
@@ -90,7 +98,7 @@ public class CheckInitializationEndpointTests : IClassFixture<AuthenticatedLumin
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task CheckInitialization_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
@@ -111,6 +119,7 @@ public class CheckInitializationEndpointTests : IClassFixture<AuthenticatedLumin
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = new PasswordHashService().HashString("TestPass123!"),
|
||||
Libraries = [],
|
||||
|
||||
+5
-4
@@ -60,7 +60,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldSetupApplicationSuccessfully()
|
||||
public async Task SetupApplication_WhenCalledWithValidRequestAnd2FA_ShouldSetupApplicationSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -94,7 +94,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequestWithout2FA_ShouldSetupApplicationSuccessfully()
|
||||
public async Task SetupApplication_WhenCalledWithValidRequestWithout2FA_ShouldSetupApplicationSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -126,7 +126,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenAdminAccountAlreadyExists_ShouldReturnConflict()
|
||||
public async Task SetupApplication_WhenAdminAccountAlreadyExists_ShouldReturnConflict()
|
||||
{
|
||||
// Arrange
|
||||
await CreateTestUser();
|
||||
@@ -156,7 +156,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task SetupApplication_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest? request = null;
|
||||
@@ -214,6 +214,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = new PasswordHashService().HashString("TestPass123!"),
|
||||
Libraries = [],
|
||||
|
||||
+6
-6
@@ -54,7 +54,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldChangePasswordSuccessfully()
|
||||
public async Task ChangePassword_WhenCalledWithValidRequest_ShouldChangePasswordSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -79,7 +79,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
public async Task ChangePassword_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -113,7 +113,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task ChangePassword_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -142,7 +142,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCurrentPasswordIsIncorrect_ShouldReturnForbiddenResult()
|
||||
public async Task ChangePassword_WhenCurrentPasswordIsIncorrect_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -171,7 +171,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task ChangePassword_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest? request = null;
|
||||
@@ -203,7 +203,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task ChangePassword_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnUsers()
|
||||
public async Task GetUsers_WhenCalledWithValidRequest_ShouldReturnUsers()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/auth/users");
|
||||
@@ -77,7 +77,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetUsers_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -101,7 +101,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetUsers_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+10
-6
@@ -66,7 +66,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidCredentials_ShouldLoginSuccessfully()
|
||||
public async Task Login_WhenCalledWithValidCredentials_ShouldLoginSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUser();
|
||||
@@ -93,7 +93,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidCredentialsAndTotp_ShouldLoginSuccessfully()
|
||||
public async Task Login_WhenCalledWithValidCredentialsAndTotp_ShouldLoginSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithTotp();
|
||||
@@ -125,7 +125,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithTempPassword_ShouldLoginSuccessfully()
|
||||
public async Task Login_WhenCalledWithTempPassword_ShouldLoginSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithTempPassword();
|
||||
@@ -151,7 +151,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithExpiredTempPassword_ShouldReturnUnauthorized()
|
||||
public async Task Login_WhenCalledWithExpiredTempPassword_ShouldReturnUnauthorized()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithExpiredTempPassword();
|
||||
@@ -179,7 +179,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidCredentials_ShouldReturnUnauthorized()
|
||||
public async Task Login_WhenCalledWithInvalidCredentials_ShouldReturnUnauthorized()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUser();
|
||||
@@ -207,7 +207,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidTotpCode_ShouldReturnUnauthorized()
|
||||
public async Task Login_WhenCalledWithInvalidTotpCode_ShouldReturnUnauthorized()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithTotp();
|
||||
@@ -247,6 +247,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
Libraries = [],
|
||||
@@ -269,6 +270,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
byte[] totpSecret = _totpTokenGenerator.GenerateSecret();
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
TotpSecret = _cryptographyService.Encrypt(Convert.ToBase64String(totpSecret)),
|
||||
@@ -291,6 +293,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
TempPassword = Uri.EscapeDataString(_hashService.HashString("TempPass123!")),
|
||||
@@ -314,6 +317,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
TempPassword = Uri.EscapeDataString(_hashService.HashString("TempPass123!")),
|
||||
|
||||
+9
-7
@@ -69,7 +69,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldResetPassword()
|
||||
public async Task RecoverPassword_WhenCalledWithValidRequest_ShouldResetPassword()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateUserWithTotp();
|
||||
@@ -113,7 +113,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task RecoverPassword_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest request = new(
|
||||
@@ -140,7 +140,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenInvalidTotpCode_ShouldReturnForbiddenResult()
|
||||
public async Task RecoverPassword_WhenInvalidTotpCode_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateUserWithTotp();
|
||||
@@ -173,7 +173,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task RecoverPassword_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest? request = null;
|
||||
@@ -203,7 +203,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotUseTotpAndTriesToRecover_ShouldReturnForbiddenResult()
|
||||
public async Task RecoverPassword_WhenUserDoesNotUseTotpAndTriesToRecover_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateUserWithoutTotp();
|
||||
@@ -237,7 +237,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotUseTotpAndTriesToRecoverWithoutCode_ShouldReturnForbiddenResult()
|
||||
public async Task RecoverPassword_WhenUserDoesNotUseTotpAndTriesToRecoverWithoutCode_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
// Setup user without TOTP
|
||||
@@ -246,6 +246,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
|
||||
UserEntity userWithoutTotp = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = "userwithoutotp2",
|
||||
Password = _hashService.HashString("OldPass123!"),
|
||||
TotpSecret = null, // No TOTP configured
|
||||
@@ -288,7 +289,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task RecoverPassword_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest request = new(
|
||||
@@ -314,6 +315,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
byte[] totpSecret = _totpTokenGenerator.GenerateSecret();
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("OldPass123!"),
|
||||
TotpSecret = _cryptographyService.Encrypt(Convert.ToBase64String(totpSecret)),
|
||||
|
||||
+6
-5
@@ -57,7 +57,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldRegisterUserSuccessfully()
|
||||
public async Task Register_WhenCalledWithValidRequest_ShouldRegisterUserSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -85,7 +85,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldRegisterUserWithTotp()
|
||||
public async Task Register_WhenCalledWithValidRequestAnd2FA_ShouldRegisterUserWithTotp()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -112,7 +112,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUsernameAlreadyExists_ShouldReturnConflict()
|
||||
public async Task Register_WhenUsernameAlreadyExists_ShouldReturnConflict()
|
||||
{
|
||||
// Arrange
|
||||
await CreateTestUser();
|
||||
@@ -138,7 +138,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
public async Task Register_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -164,7 +164,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task Register_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest? request = null;
|
||||
@@ -193,6 +193,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = new PasswordHashService().HashString("TestPass123!"),
|
||||
Libraries = [],
|
||||
|
||||
+4
-4
@@ -65,7 +65,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnAuthorizationDetails()
|
||||
public async Task GetAuthorization_WhenCalledWithValidRequest_ShouldReturnAuthorizationDetails()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -97,7 +97,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnForbiddenResult()
|
||||
public async Task GetAuthorization_WhenUserDoesNotExist_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
GetAuthorizationRequest request = new(Guid.NewGuid());
|
||||
@@ -121,7 +121,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserIdIsEmpty_ShouldReturnValidationError()
|
||||
public async Task GetAuthorization_WhenUserIdIsEmpty_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
GetAuthorizationRequest request = new(Guid.Empty);
|
||||
@@ -150,7 +150,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetAuthorization_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
GetAuthorizationRequest request = new(Guid.NewGuid());
|
||||
|
||||
+4
-4
@@ -55,7 +55,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnUserPermissions()
|
||||
public async Task GetUserPermissions_WhenCalledWithValidRequest_ShouldReturnUserPermissions()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -97,7 +97,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetUserPermissions_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -125,7 +125,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task GetUserPermissions_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentUserId = Guid.NewGuid();
|
||||
@@ -149,7 +149,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetUserPermissions_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -54,7 +54,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnUserRole()
|
||||
public async Task GetUserRole_WhenCalledWithValidRequest_ShouldReturnUserRole()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -78,7 +78,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetUserRole_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -106,7 +106,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task GetUserRole_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentUserId = Guid.NewGuid();
|
||||
@@ -130,7 +130,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetUserRole_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+5
-5
@@ -56,7 +56,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldUpdateUserRoleAndPermissions()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenCalledWithValidRequest_ShouldUpdateUserRoleAndPermissions()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -114,7 +114,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -143,7 +143,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenTryingToRemoveLastAdmin_ShouldReturnForbiddenResult()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenTryingToRemoveLastAdmin_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -188,7 +188,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentUserId = Guid.NewGuid();
|
||||
@@ -217,7 +217,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ public class LoginEndpointTests : IClassFixture<LuminaApiFactory>, IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRateLimitExceeded_ShouldReturnTooManyRequests()
|
||||
public async Task Login_WhenRateLimitExceeded_ShouldReturnTooManyRequests()
|
||||
{
|
||||
// Arrange
|
||||
// set a fake IP for this test instance
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<LuminaApiFactory>, IDi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRateLimitExceeded_ShouldReturnTooManyRequests()
|
||||
public async Task RecoverPassword_WhenRateLimitExceeded_ShouldReturnTooManyRequests()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest request = new(
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.Maintenance.ApplicationSetup.Queries.CheckInitiliazation;
|
||||
namespace Lumina.Application.UnitTests.Core.Maintenance.ApplicationSetup.Queries.CheckInitialization;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="CheckInitializationQueryHandler"/> class.
|
||||
+2
@@ -11,6 +11,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.Plugins.Commands.ReorderLibraryMetadataProviders;
|
||||
@@ -18,6 +19,7 @@ namespace Lumina.Application.UnitTests.Core.Plugins.Commands.ReorderLibraryMetad
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="ReorderLibraryMetadataProvidersCommandHandler"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderLibraryMetadataProvidersCommandHandlerTests
|
||||
{
|
||||
private readonly IUnitOfWork _mockUnitOfWork;
|
||||
|
||||
+2
@@ -10,6 +10,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.Plugins.Commands.SetLibraryMetadataProviderEnabled;
|
||||
@@ -17,6 +18,7 @@ namespace Lumina.Application.UnitTests.Core.Plugins.Commands.SetLibraryMetadataP
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="SetLibraryMetadataProviderEnabledCommandHandler"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetLibraryMetadataProviderEnabledCommandHandlerTests
|
||||
{
|
||||
private readonly IUnitOfWork _mockUnitOfWork;
|
||||
|
||||
+2
@@ -9,6 +9,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.Plugins.Commands.UpdatePluginSettings;
|
||||
@@ -16,6 +17,7 @@ namespace Lumina.Application.UnitTests.Core.Plugins.Commands.UpdatePluginSetting
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="UpdatePluginSettingsCommandHandler"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UpdatePluginSettingsCommandHandlerTests
|
||||
{
|
||||
private readonly IUnitOfWork _mockUnitOfWork;
|
||||
|
||||
+2
@@ -10,6 +10,7 @@ using NSubstitute;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.UnitTests.Core.Plugins.Queries.GetPlugins;
|
||||
@@ -17,6 +18,7 @@ namespace Lumina.Application.UnitTests.Core.Plugins.Queries.GetPlugins;
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="GetPluginsQueryHandler"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetPluginsQueryHandlerTests
|
||||
{
|
||||
private readonly IUnitOfWork _mockUnitOfWork;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="Directory"/> class.
|
||||
+1
-1
@@ -8,7 +8,7 @@ using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="File"/> class.
|
||||
+1
-1
@@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="UnixRootItem"/> class.
|
||||
+1
-1
@@ -9,7 +9,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Entities;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WindowsRootItem"/> class.
|
||||
+1
-1
@@ -11,7 +11,7 @@ using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileSystemItem"/> class.
|
||||
+1
-1
@@ -19,7 +19,7 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="DirectoryProviderService"/> class.
|
||||
+1
-1
@@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="DirectoryService"/> class.
|
||||
+1
-1
@@ -12,7 +12,7 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="DriveService"/> class.
|
||||
+1
-1
@@ -18,7 +18,7 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileProviderService"/> class.
|
||||
+1
-1
@@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileService"/> class.
|
||||
+1
-1
@@ -18,7 +18,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileTypeService"/> class.
|
||||
+1
-1
@@ -12,7 +12,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PathService"/> class.
|
||||
+2
-2
@@ -4,7 +4,7 @@ using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Environment;
|
||||
using Lumina.Domain.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.SharedKernel.Fixtures.Common.Enums.PhotoLibrary;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.PhotoLibrary;
|
||||
using NSubstitute;
|
||||
@@ -17,7 +17,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Services;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="ThumbnailService"/> class.
|
||||
+1
-1
@@ -5,7 +5,7 @@ using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Environment;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Environment;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="EnvironmentContext"/> class.
|
||||
+1
-1
@@ -11,7 +11,7 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Path;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="UnixPathStrategy"/> class.
|
||||
+1
-1
@@ -11,7 +11,7 @@ using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Path;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Path;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WindowsPathStrategy"/> class.
|
||||
+1
-1
@@ -8,7 +8,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO.Abstractions;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PlatformContextFactory"/> class.
|
||||
+1
-1
@@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PlatformContextManager"/> class.
|
||||
+1
-1
@@ -6,7 +6,7 @@ using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.Strategies.Platform;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.Strategies.Platform;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WindowsPlatformContext"/> and <see cref="UnixPlatformContext"/> classes.
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Lumina.Domain.Fixtures.Core.BoundedContexts.FileSystemManagementBoundedCon
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="FileSystemPathId"/> class.
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Lumina.Domain.Fixtures.Core.BoundedContexts.FileSystemManagementBoundedCon
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="PathSegment"/> class.
|
||||
+1
-1
@@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="StreamInfo"/> class.
|
||||
+1
-1
@@ -8,7 +8,7 @@ using System.Linq;
|
||||
#endregion
|
||||
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.FileSystemManagementAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.FileSystemManagementBoundedContext.FileSystemManagementAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="Thumbnail"/> class.
|
||||
+1
-1
@@ -6,7 +6,7 @@ using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Aggregates.BookLibraryAggregate;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="Book"/> class.
|
||||
@@ -42,5 +42,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Lumina.Domain\Lumina.Domain.csproj" />
|
||||
<ProjectReference Include="..\..\Common\Lumina.Domain.Fixtures\Lumina.Domain.Fixtures.csproj" />
|
||||
<ProjectReference Include="..\..\Common\Lumina.Domain.SharedKernel.Fixtures\Lumina.Domain.SharedKernel.Fixtures.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+2
-2
@@ -29,7 +29,7 @@ public class CommonSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CommonSettingsModelValidator_WhenThemeProvided_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenThemeProvided_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
CommonSettingsDto model = _fixture.Build<CommonSettingsDto>()
|
||||
@@ -44,7 +44,7 @@ public class CommonSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CommonSettingsModelValidator_WhenThemeNotProvided_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenThemeNotProvided_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
CommonSettingsDto model = _fixture.Build<CommonSettingsDto>()
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ public class DatabaseSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DatabaseSettingsModelValidator_WhenDefaultConnectionProvided_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenDefaultConnectionProvided_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
DatabaseSettingsDto model = _fixture.Build<DatabaseSettingsDto>()
|
||||
@@ -44,7 +44,7 @@ public class DatabaseSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DatabaseSettingsModelValidator_WhenDefaultConnectionNotProvided_ShouldHaveValidationError()
|
||||
public void Validate_WhenDefaultConnectionNotProvided_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
DatabaseSettingsDto model = _fixture.Build<DatabaseSettingsDto>()
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ public class EncryptionSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EncryptionSettingsModelValidator_WhenValidBase64SecretKeyProvided_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenValidBase64SecretKeyProvided_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
EncryptionSettingsDto model = _fixture.Build<EncryptionSettingsDto>()
|
||||
@@ -44,7 +44,7 @@ public class EncryptionSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EncryptionSettingsModelValidator_WhenSecretKeyIsEmpty_ShouldHaveValidationError()
|
||||
public void Validate_WhenSecretKeyIsEmpty_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
EncryptionSettingsDto model = _fixture.Build<EncryptionSettingsDto>()
|
||||
@@ -63,7 +63,7 @@ public class EncryptionSettingsDtoValidatorTests
|
||||
[InlineData("not-a-base64-string")]
|
||||
[InlineData("invalid!base64")]
|
||||
[InlineData("123")]
|
||||
public void EncryptionSettingsModelValidator_WhenSecretKeyIsNotBase64_ShouldHaveValidationError(string invalidBase64)
|
||||
public void Validate_WhenSecretKeyIsNotBase64_ShouldHaveValidationError(string invalidBase64)
|
||||
{
|
||||
// Arrange
|
||||
EncryptionSettingsDto model = _fixture.Build<EncryptionSettingsDto>()
|
||||
|
||||
+6
-6
@@ -29,7 +29,7 @@ public class JwtSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JwtSettingsModelValidator_WhenAllPropertiesValid_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenAllPropertiesValid_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
JwtSettingsDto model = _fixture.Build<JwtSettingsDto>()
|
||||
@@ -47,7 +47,7 @@ public class JwtSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JwtSettingsModelValidator_WhenSecretKeyIsEmpty_ShouldHaveValidationErrors()
|
||||
public void Validate_WhenSecretKeyIsEmpty_ShouldHaveValidationErrors()
|
||||
{
|
||||
// Arrange
|
||||
JwtSettingsDto model = _fixture.Build<JwtSettingsDto>()
|
||||
@@ -67,7 +67,7 @@ public class JwtSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JwtSettingsModelValidator_WhenSecretKeyTooShort_ShouldHaveValidationError()
|
||||
public void Validate_WhenSecretKeyTooShort_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
JwtSettingsDto model = _fixture.Build<JwtSettingsDto>()
|
||||
@@ -89,7 +89,7 @@ public class JwtSettingsDtoValidatorTests
|
||||
[InlineData(0)]
|
||||
[InlineData(-1)]
|
||||
[InlineData(-60)]
|
||||
public void JwtSettingsModelValidator_WhenExpiryMinutesNotPositive_ShouldHaveValidationError(int minutes)
|
||||
public void Validate_WhenExpiryMinutesNotPositive_ShouldHaveValidationError(int minutes)
|
||||
{
|
||||
// Arrange
|
||||
JwtSettingsDto model = _fixture.Build<JwtSettingsDto>()
|
||||
@@ -108,7 +108,7 @@ public class JwtSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JwtSettingsModelValidator_WhenIssuerIsEmpty_ShouldHaveValidationError()
|
||||
public void Validate_WhenIssuerIsEmpty_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
JwtSettingsDto model = _fixture.Build<JwtSettingsDto>()
|
||||
@@ -127,7 +127,7 @@ public class JwtSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JwtSettingsModelValidator_WhenAudienceIsEmpty_ShouldHaveValidationError()
|
||||
public void Validate_WhenAudienceIsEmpty_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
JwtSettingsDto model = _fixture.Build<JwtSettingsDto>()
|
||||
|
||||
+6
-6
@@ -29,7 +29,7 @@ public class MediaSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MediaSettingsModelValidator_WhenRootDirectoryProvided_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenRootDirectoryProvided_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
MediaSettingsDto model = _fixture.Build<MediaSettingsDto>()
|
||||
@@ -44,7 +44,7 @@ public class MediaSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MediaSettingsModelValidator_WhenRootDirectoryIsEmpty_ShouldHaveValidationError()
|
||||
public void Validate_WhenRootDirectoryIsEmpty_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
MediaSettingsDto model = _fixture.Build<MediaSettingsDto>()
|
||||
@@ -60,7 +60,7 @@ public class MediaSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MediaSettingsModelValidator_WhenRootDirectoryIsWhitespace_ShouldHaveValidationError()
|
||||
public void Validate_WhenRootDirectoryIsWhitespace_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
MediaSettingsDto model = _fixture.Build<MediaSettingsDto>()
|
||||
@@ -76,7 +76,7 @@ public class MediaSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MediaSettingsModelValidator_WhenMediaLibrariesDirectoryIsEmpty_ShouldHaveValidationError()
|
||||
public void Validate_WhenMediaLibrariesDirectoryIsEmpty_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
MediaSettingsDto model = _fixture.Build<MediaSettingsDto>()
|
||||
@@ -92,7 +92,7 @@ public class MediaSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MediaSettingsModelValidator_WhenMediaLibrariesDirectoryProvided_ShouldNotHaveValidationError()
|
||||
public void Validate_WhenMediaLibrariesDirectoryProvided_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
MediaSettingsDto model = _fixture.Build<MediaSettingsDto>()
|
||||
@@ -107,7 +107,7 @@ public class MediaSettingsDtoValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MediaSettingsModelValidator_WhenMediaLibrariesDirectoryIsWhitespace_ShouldHaveValidationError()
|
||||
public void Validate_WhenMediaLibrariesDirectoryIsWhitespace_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
MediaSettingsDto model = _fixture.Build<MediaSettingsDto>()
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Plugins.Contracts.UnitTests.Fakes;
|
||||
namespace Lumina.Plugins.Contracts.UnitTests.Common.Fakes;
|
||||
|
||||
/// <summary>
|
||||
/// A fake book metadata provider used to exercise the plugin contracts from outside.
|
||||
+8
-6
@@ -2,21 +2,23 @@
|
||||
using Lumina.Contracts.DTO.Common;
|
||||
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
|
||||
using Lumina.Plugins.Contracts.Core.Metadata;
|
||||
using Lumina.Plugins.Contracts.UnitTests.Fakes;
|
||||
using Lumina.Plugins.Contracts.UnitTests.Common.Fakes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Plugins.Contracts.UnitTests.Metadata;
|
||||
namespace Lumina.Plugins.Contracts.UnitTests.Core.Metadata;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="IRemoteMetadataProvider"/> contracts.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class RemoteMetadataProviderTests
|
||||
{
|
||||
private readonly IRemoteMetadataProvider _provider = new FakeBookMetadataProvider();
|
||||
private readonly IRemoteMetadataProvider _sut = new FakeBookMetadataProvider();
|
||||
|
||||
[Fact]
|
||||
public async Task GetMetadataAsync_WhenCalledThroughNonGenericInterface_ShouldReturnTypedMetadata()
|
||||
@@ -28,7 +30,7 @@ public class RemoteMetadataProviderTests
|
||||
Title: "The Fellowship of the Ring");
|
||||
|
||||
// Act
|
||||
MetadataDto? result = await _provider.GetMetadataAsync(lookup, CancellationToken.None);
|
||||
MetadataDto? result = await _sut.GetMetadataAsync(lookup, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(result);
|
||||
@@ -46,7 +48,7 @@ public class RemoteMetadataProviderTests
|
||||
Path: "/books/unknown.epub");
|
||||
|
||||
// Act
|
||||
MetadataDto? result = await _provider.GetMetadataAsync(lookup, CancellationToken.None);
|
||||
MetadataDto? result = await _sut.GetMetadataAsync(lookup, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.Null(result);
|
||||
@@ -62,7 +64,7 @@ public class RemoteMetadataProviderTests
|
||||
Title: "The Fellowship of the Ring");
|
||||
|
||||
// Act
|
||||
IReadOnlyList<MetadataDto> result = await _provider.GetSearchResultsAsync(lookup, CancellationToken.None);
|
||||
IReadOnlyList<MetadataDto> result = await _sut.GetSearchResultsAsync(lookup, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.Single(result);
|
||||
+8
-4
@@ -1,24 +1,28 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Plugins.Contracts.Core.Plugins;
|
||||
using Lumina.Plugins.Contracts.Core.Plugins.Settings;
|
||||
using Lumina.Plugins.Contracts.UnitTests.Fakes;
|
||||
using Lumina.Plugins.Contracts.UnitTests.Common.Fakes;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Plugins.Contracts.UnitTests.Plugins;
|
||||
namespace Lumina.Plugins.Contracts.UnitTests.Core.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="IPlugin"/> contract.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PluginTests
|
||||
{
|
||||
private readonly IPlugin _plugin = new FakeBookMetadataProvider();
|
||||
private readonly IPlugin _sut = new FakeBookMetadataProvider();
|
||||
|
||||
[Fact]
|
||||
public void GetSettingsSchema_WhenCalled_ShouldReturnDeclaredSettings()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
IReadOnlyList<PluginSettingDescriptor> schema = _plugin.GetSettingsSchema();
|
||||
IReadOnlyList<PluginSettingDescriptor> schema = _sut.GetSettingsSchema();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(2, schema.Count);
|
||||
+3
-3
@@ -20,15 +20,15 @@ namespace Lumina.Presentation.Api.UnitTests.Core.Endpoints.FileSystemManagement.
|
||||
/// Contains unit tests for the <see cref="GetTypeEndpoint"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetFileSystemTypeEndpointTests
|
||||
public class GetTypeEndpointTests
|
||||
{
|
||||
private readonly IQueryHandler<GetFileSystemQuery, FileSystemTypeResponse> _mockHandler;
|
||||
private readonly GetTypeEndpoint _sut;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetFileSystemTypeEndpointTests"/> class.
|
||||
/// Initializes a new instance of the <see cref="GetTypeEndpointTests"/> class.
|
||||
/// </summary>
|
||||
public GetFileSystemTypeEndpointTests()
|
||||
public GetTypeEndpointTests()
|
||||
{
|
||||
_mockHandler = Substitute.For<IQueryHandler<GetFileSystemQuery, FileSystemTypeResponse>>();
|
||||
_sut = Factory.Create<GetTypeEndpoint>(_mockHandler);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lumina.Presentation.Api.UnitTests.Core.Endpoints.WrittenContentLibrary.BookLibrary.Books;
|
||||
namespace Lumina.Presentation.Api.UnitTests.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.AddBook;
|
||||
internal class AddBookEndpointTests
|
||||
{
|
||||
}
|
||||
Reference in new issue
Block a user