diff --git a/docs/technical/api/file-system-management/Api.Directories.md b/docs/technical/api/file-system-management/Api.Directories.md index cd57e035..b1fc79e6 100644 --- a/docs/technical/api/file-system-management/Api.Directories.md +++ b/docs/technical/api/file-system-management/Api.Directories.md @@ -16,7 +16,7 @@ ##### Get Directories Request ```js -GET api/v1/directories/get-directories?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET api/v1/directories/get-directories?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true ``` ##### Get Directories Response diff --git a/docs/technical/api/file-system-management/Api.Files.md b/docs/technical/api/file-system-management/Api.Files.md index 41b33576..2b6ae344 100644 --- a/docs/technical/api/file-system-management/Api.Files.md +++ b/docs/technical/api/file-system-management/Api.Files.md @@ -19,7 +19,7 @@ ##### Get Files Request ```js -GET api/v1/files/get-files?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET api/v1/files/get-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true ``` ##### Get Files Response @@ -52,7 +52,7 @@ GET api/v1/files/get-files?path=C%3A%5CUsers%5C&includeHiddenElements=true ##### Get Tree Files Request ```js -GET api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true ``` ##### Get Tree Files Response diff --git a/docs/technical/api/file-system-management/Api.Path.md b/docs/technical/api/file-system-management/Api.Path.md index 251cb768..61042176 100644 --- a/docs/technical/api/file-system-management/Api.Path.md +++ b/docs/technical/api/file-system-management/Api.Path.md @@ -34,7 +34,7 @@ ##### Check Path Exists Request ```js -GET api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true ``` ##### Check Path Exists Response diff --git a/docs/technical/requests/file-system-management/directories/GetDirectories.http b/docs/technical/requests/file-system-management/directories/GetDirectories.http index e915ad5a..6023595c 100644 --- a/docs/technical/requests/file-system-management/directories/GetDirectories.http +++ b/docs/technical/requests/file-system-management/directories/GetDirectories.http @@ -1,2 +1,2 @@ -GET {{host}}/api/v1/directories/get-directories?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET {{host}}/api/v1/directories/get-directories?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/docs/technical/requests/file-system-management/files/GetFiles.http b/docs/technical/requests/file-system-management/files/GetFiles.http index 7f81bff0..74987a51 100644 --- a/docs/technical/requests/file-system-management/files/GetFiles.http +++ b/docs/technical/requests/file-system-management/files/GetFiles.http @@ -1,2 +1,2 @@ -GET {{host}}/api/v1/files/get-files?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET {{host}}/api/v1/files/get-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/docs/technical/requests/file-system-management/files/GetTreeFiles.http b/docs/technical/requests/file-system-management/files/GetTreeFiles.http index 727d0571..f072c653 100644 --- a/docs/technical/requests/file-system-management/files/GetTreeFiles.http +++ b/docs/technical/requests/file-system-management/files/GetTreeFiles.http @@ -1,2 +1,2 @@ -GET {{host}}/api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET {{host}}/api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/docs/technical/requests/file-system-management/path/CheckPathExists.http b/docs/technical/requests/file-system-management/path/CheckPathExists.http index 281525ce..11d1ea50 100644 --- a/docs/technical/requests/file-system-management/path/CheckPathExists.http +++ b/docs/technical/requests/file-system-management/path/CheckPathExists.http @@ -1,2 +1,2 @@ -GET {{host}}/api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&includeHiddenElements=true +GET {{host}}/api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/src/Lumina.Application/Common/DataAccess/Repositories/Common/Actions/IGetAllLiteRepositoryAction.cs b/src/Lumina.Application/Common/DataAccess/Repositories/Common/Actions/IGetAllLiteRepositoryAction.cs index 98a5a7a2..674de39b 100644 --- a/src/Lumina.Application/Common/DataAccess/Repositories/Common/Actions/IGetAllLiteRepositoryAction.cs +++ b/src/Lumina.Application/Common/DataAccess/Repositories/Common/Actions/IGetAllLiteRepositoryAction.cs @@ -27,9 +27,9 @@ public interface IGetAllLiteRepositoryAction where TModel : IS /// The name of the field by which to sort the results. /// The direction in which to sort the results. /// The model containing the parameters used to filter the results. - /// Whether the navigation properties of the entities should be loaded together with the entities themselves. Pass to retrieve only the data stored directly on the entity rows. + /// Whether the navigation properties of the entities should be loaded together with the entities themselves. Pass to retrieve only the data stored directly on the entity rows. /// Whether the retrieved entities should be tracked by the persistence medium, so that changes to them can be saved. Pass for read-only scenarios, to avoid the tracking overhead. /// Cancellation token that can be used to stop the execution. /// An containing either a paginated result of type , or an error. - Task>> GetAllLiteAsync(PaginationDataDto? paginationData = null, string? sortBy = null, SortOrder? sortOrder = null, TFilter? filterModel = null, bool includeNavigationProperties = false, bool shouldTrackEntities = false, CancellationToken cancellationToken = default) where TFilter : BaseFilterDto; + Task>> GetAllLiteAsync(PaginationDataDto? paginationData = null, string? sortBy = null, SortOrder? sortOrder = null, TFilter? filterModel = null, bool shouldIncludeNavigationProperties = false, bool shouldTrackEntities = false, CancellationToken cancellationToken = default) where TFilter : BaseFilterDto; } diff --git a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMapping.cs b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMapping.cs index b57de0a7..5a82ccf9 100644 --- a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMapping.cs +++ b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMapping.cs @@ -17,6 +17,6 @@ public static class GetDirectoriesRequestMapping /// The converted query. public static GetDirectoriesQuery ToQuery(this GetDirectoriesRequest request) { - return new GetDirectoriesQuery(request.Path, request.IncludeHiddenElements); + return new GetDirectoriesQuery(request.Path, request.ShouldIncludeHiddenElements); } } diff --git a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMapping.cs b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMapping.cs index 76bda209..58ed16e4 100644 --- a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMapping.cs +++ b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMapping.cs @@ -17,6 +17,6 @@ public static class GetFilesRequestMapping /// The converted query. public static GetFilesQuery ToQuery(this GetFilesRequest request) { - return new GetFilesQuery(request.Path, request.IncludeHiddenElements); + return new GetFilesQuery(request.Path, request.ShouldIncludeHiddenElements); } } diff --git a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMapping.cs b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMapping.cs index 0581cee4..05490543 100644 --- a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMapping.cs +++ b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMapping.cs @@ -17,6 +17,6 @@ public static class GetTreeFilesRequestMapping /// The converted query. public static GetTreeFilesQuery ToQuery(this GetTreeFilesRequest request) { - return new GetTreeFilesQuery(request.Path, request.IncludeHiddenElements); + return new GetTreeFilesQuery(request.Path, request.ShouldIncludeHiddenElements); } } diff --git a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMapping.cs b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMapping.cs index d34f0eb2..c67bd66a 100644 --- a/src/Lumina.Application/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMapping.cs +++ b/src/Lumina.Application/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMapping.cs @@ -19,7 +19,7 @@ public static class CheckPathExistsRequestMapping { return new CheckPathExistsQuery( request.Path, - request.IncludeHiddenElements + request.ShouldIncludeHiddenElements ); } } diff --git a/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQuery.cs b/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQuery.cs index 86da3e1c..8bfa3b38 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQuery.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQuery.cs @@ -9,9 +9,9 @@ namespace Lumina.Application.Core.FileSystemManagement.Directories.Queries.GetDi /// Query for retrieving the list of directories at a path. /// /// The path for which to retrieve the list of directories. -/// Whether to include hidden directories or not. +/// Whether to include hidden directories or not. [DebuggerDisplay("Path: {Path}")] public record GetDirectoriesQuery( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ) : IQuery; diff --git a/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandler.cs b/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandler.cs index 50461153..8c44110a 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandler.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandler.cs @@ -46,7 +46,7 @@ public class GetDirectoriesQueryHandler : IQueryHandler 0) return Task.FromResult>>(validationResult); - Result> getSubdirectoriesResult = _directoryService.GetSubdirectories(query.Path!, query.IncludeHiddenElements); + Result> getSubdirectoriesResult = _directoryService.GetSubdirectories(query.Path!, query.ShouldIncludeHiddenElements); return Task.FromResult(getSubdirectoriesResult.Match(values => Result.From(values.ToResponses()), errors => errors)); } } diff --git a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQuery.cs b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQuery.cs index b5351d79..6f6e823e 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQuery.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQuery.cs @@ -9,9 +9,9 @@ namespace Lumina.Application.Core.FileSystemManagement.Files.Queries.GetFiles; /// Query for retrieving the list of files at a path. /// /// The path for which to retrieve the list of files. -/// Whether to include hidden files and directories or not. +/// Whether to include hidden files and directories or not. [DebuggerDisplay("Path: {Path}")] public record GetFilesQuery( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ) : IQuery; diff --git a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandler.cs b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandler.cs index 5718613e..dfed7239 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandler.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandler.cs @@ -46,7 +46,7 @@ public class GetFilesQueryHandler : IQueryHandler 0) return Task.FromResult>>(validationResult); - Result> getFilesResult = _fileService.GetFiles(query.Path!, query.IncludeHiddenElements); + Result> getFilesResult = _fileService.GetFiles(query.Path!, query.ShouldIncludeHiddenElements); return Task.FromResult(getFilesResult.Match(values => Result.From(values.ToResponses()), errors => errors)); } } diff --git a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQuery.cs b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQuery.cs index 452debc6..73d0b124 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQuery.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQuery.cs @@ -9,9 +9,9 @@ namespace Lumina.Application.Core.FileSystemManagement.Files.Queries.GetTreeFile /// Query for retrieving the list of files at a path. /// /// The path for which to retrieve the list of files. -/// Whether to include hidden files and directories or not. +/// Whether to include hidden files and directories or not. [DebuggerDisplay("Path: {Path}")] public record GetTreeFilesQuery( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ) : IQuery; diff --git a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandler.cs b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandler.cs index 586660e2..5360735e 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandler.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandler.cs @@ -46,7 +46,7 @@ public class GetTreeFilesQueryHandler : IQueryHandler 0) return Task.FromResult>>(validationResult); - Result> getFilesResult = _fileService.GetFiles(query.Path!, query.IncludeHiddenElements); + Result> getFilesResult = _fileService.GetFiles(query.Path!, query.ShouldIncludeHiddenElements); return Task.FromResult(getFilesResult.Match(values => Result.From(values.ToFileSystemTreeNodeResponses()), errors => errors)); } } diff --git a/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQuery.cs b/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQuery.cs index 02ce1e37..95d8c79a 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQuery.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQuery.cs @@ -9,9 +9,9 @@ namespace Lumina.Application.Core.FileSystemManagement.Paths.Queries.CheckPathEx /// Query for checking the existence of a file system path. /// /// The path for which to check the existence of. -/// Whether to include hidden file system elements or not. -[DebuggerDisplay("Path: {Path}, IncludeHiddenElements: {IncludeHiddenElements}")] +/// Whether to include hidden file system elements or not. +[DebuggerDisplay("Path: {Path}, ShouldIncludeHiddenElements: {ShouldIncludeHiddenElements}")] public record CheckPathExistsQuery( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ) : IQuery; diff --git a/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryHandler.cs b/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryHandler.cs index 8e90b042..f83caf6c 100644 --- a/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryHandler.cs +++ b/src/Lumina.Application/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryHandler.cs @@ -44,6 +44,6 @@ public class CheckPathExistsQueryHandler : IQueryHandler 0) return Task.FromResult>(validationResult); - return Task.FromResult(Result.From(new PathExistsResponse(_pathService.Exists(query.Path!, query.IncludeHiddenElements)))); + return Task.FromResult(Result.From(new PathExistsResponse(_pathService.Exists(query.Path!, query.ShouldIncludeHiddenElements)))); } } diff --git a/src/Lumina.Contracts/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs b/src/Lumina.Contracts/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs index 7bcff9cb..c51d9910 100644 --- a/src/Lumina.Contracts/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs +++ b/src/Lumina.Contracts/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs @@ -9,9 +9,9 @@ namespace Lumina.Contracts.Requests.FileSystemManagement.Directories; /// Represents a request to get the directories of a file system path. /// /// The file system path for which to get the directories. Required. -/// Whether to include hidden file system elements or not. Optional. +/// Whether to include hidden file system elements or not. Optional. [DebuggerDisplay("Path: {Path}")] public record GetDirectoriesRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetFilesRequest.cs b/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetFilesRequest.cs index e751efc9..87b8412e 100644 --- a/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetFilesRequest.cs +++ b/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetFilesRequest.cs @@ -9,9 +9,9 @@ namespace Lumina.Contracts.Requests.FileSystemManagement.Files; /// Represents a request to get the files at a file system path. /// /// The file system path for which to get the files. Required. -/// Whether to include hidden file system elements or not. Optional. +/// Whether to include hidden file system elements or not. Optional. [DebuggerDisplay("Path: {Path}")] public record GetFilesRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs b/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs index a5660c6f..53fc694e 100644 --- a/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs +++ b/src/Lumina.Contracts/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs @@ -9,9 +9,9 @@ namespace Lumina.Contracts.Requests.FileSystemManagement.Files; /// Represents a request to get the files of a file system path. /// /// The file system path for which to get the tree files. Required. -/// Whether to include hidden file system elements or not. Optional. +/// Whether to include hidden file system elements or not. Optional. [DebuggerDisplay("Path: {Path}")] public record GetTreeFilesRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Contracts/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs b/src/Lumina.Contracts/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs index 16990e50..845d011d 100644 --- a/src/Lumina.Contracts/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs +++ b/src/Lumina.Contracts/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs @@ -9,9 +9,9 @@ namespace Lumina.Contracts.Requests.FileSystemManagement.Path; /// Represents a request to check the existence of a file system path. /// /// The file system path to check the exitence of. Required. -/// Whether to include hidden elements in the search results, or not. Optional. -[DebuggerDisplay("Path: {Path}, IncludeHiddenElements: {IncludeHiddenElements}")] +/// Whether to include hidden elements in the search results, or not. Optional. +[DebuggerDisplay("Path: {Path}, ShouldIncludeHiddenElements: {ShouldIncludeHiddenElements}")] public record CheckPathExistsRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IDirectoryProviderService.cs b/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IDirectoryProviderService.cs index 91d2ca69..38cee2d4 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IDirectoryProviderService.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IDirectoryProviderService.cs @@ -17,9 +17,9 @@ public interface IDirectoryProviderService /// Retrieves a list of subdirectory paths from the specified path. /// /// The path from which to retrieve the subdirectory paths. - /// Whether to include hidden subdirectories or not. + /// Whether to include hidden subdirectories or not. /// An containing either a collection of directory paths or an error. - Result> GetSubdirectoryPaths(FileSystemPathId path, bool includeHiddenElements); + Result> GetSubdirectoryPaths(FileSystemPathId path, bool shouldIncludeHiddenElements); /// /// Checks if a directory with the specified path exists. @@ -63,18 +63,18 @@ public interface IDirectoryProviderService /// /// Identifier for the path where the directory to be copied is located. /// Identifier for the path where the directory will be copied. - /// Whether to override existing directories, or not. + /// Whether to override existing directories, or not. /// An containing either the copied directory, or an error. - Result CopyDirectory(FileSystemPathId sourcePath, FileSystemPathId destinationPath, bool overrideExisting); + Result CopyDirectory(FileSystemPathId sourcePath, FileSystemPathId destinationPath, bool shouldOverrideExisting); /// /// Moves a directory located at to . /// /// Identifier for the path where the directory to be moved is located. /// Identifier for the path where the directory will be moved. - /// Whether to override existing directories, or not. + /// Whether to override existing directories, or not. /// An containing either a moved directory, or an error. - Result MoveDirectory(FileSystemPathId sourcePath, FileSystemPathId destinationPath, bool overrideExisting); + Result MoveDirectory(FileSystemPathId sourcePath, FileSystemPathId destinationPath, bool shouldOverrideExisting); /// /// Renames a directory at the specified path. diff --git a/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IFileProviderService.cs b/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IFileProviderService.cs index 591ebd67..a2b45416 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IFileProviderService.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/IFileProviderService.cs @@ -17,9 +17,9 @@ public interface IFileProviderService /// Retrieves a list of files at the specified path. /// /// The path for which to retrieve the list of files. - /// Whether to include hidden files or not. + /// Whether to include hidden files or not. /// An containing either a collection of file paths, or an error. - Result> GetFilePaths(FileSystemPathId path, bool includeHiddenElements); + Result> GetFilePaths(FileSystemPathId path, bool shouldIncludeHiddenElements); /// /// Retrieves the contents of a file at the specified path. @@ -68,18 +68,18 @@ public interface IFileProviderService /// /// Identifier for the path where the file to be copied is located. /// Identifier for the path of the directory where the file will be copied. - /// Whether to override existing files, or not. + /// Whether to override existing files, or not. /// An containing either the copied file, or an error. - Result CopyFile(FileSystemPathId sourceFilePath, FileSystemPathId destinationDirectoryPath, bool overrideExisting); + Result CopyFile(FileSystemPathId sourceFilePath, FileSystemPathId destinationDirectoryPath, bool shouldOverrideExisting); /// /// Moves a file located at to . /// /// Identifier for the path where the file to be moved is located. /// Identifier for the path of the directory where the file will be moved. - /// Whether to override existing files, or not. + /// Whether to override existing files, or not. /// An containing either a moved file, or an error. - Result MoveFile(FileSystemPathId sourceFilePath, FileSystemPathId destinationDirectoryPath, bool overrideExisting); + Result MoveFile(FileSystemPathId sourceFilePath, FileSystemPathId destinationDirectoryPath, bool shouldOverrideExisting); /// /// Renames a file at the specified path. diff --git a/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Cancellation/MediaLibrariesScanCancellationTracker.cs b/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Cancellation/MediaLibrariesScanCancellationTracker.cs index 74b156ab..e88b8eb5 100644 --- a/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Cancellation/MediaLibrariesScanCancellationTracker.cs +++ b/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Cancellation/MediaLibrariesScanCancellationTracker.cs @@ -14,7 +14,7 @@ namespace Lumina.Infrastructure.Core.MediaLibrary.Management.Scanning.Cancellati internal class MediaLibrariesScanCancellationTracker : IMediaLibrariesScanCancellationTracker, IDisposable { private readonly ConcurrentDictionary _runningScans = new(); - private bool _disposed; + private bool _isDisposed; /// /// Registers a new scan operation for tracking. @@ -72,7 +72,7 @@ internal class MediaLibrariesScanCancellationTracker : IMediaLibrariesScanCancel /// public void Dispose() { - if (!_disposed) + if (!_isDisposed) { foreach (CancellationTokenSource scan in _runningScans.Values) { @@ -80,7 +80,7 @@ internal class MediaLibrariesScanCancellationTracker : IMediaLibrariesScanCancel scan.Dispose(); } _runningScans.Clear(); - _disposed = true; + _isDisposed = true; } } } diff --git a/src/Lumina.Infrastructure/Core/Themes/ThemeService.cs b/src/Lumina.Infrastructure/Core/Themes/ThemeService.cs index b26fe59c..27d82266 100644 --- a/src/Lumina.Infrastructure/Core/Themes/ThemeService.cs +++ b/src/Lumina.Infrastructure/Core/Themes/ThemeService.cs @@ -480,7 +480,7 @@ public sealed class ThemeService : IThemeService if (unixFileType == 0xA000) return PackageInvalid("Symbolic links are not allowed in theme archives."); - Result normalizedPathResult = NormalizeRelativePath(entry.FullName, allowTrailingSlash: true); + Result normalizedPathResult = NormalizeRelativePath(entry.FullName, shouldAllowTrailingSlash: true); if (normalizedPathResult.IsFailure) return normalizedPathResult.Errors; @@ -732,14 +732,14 @@ public sealed class ThemeService : IThemeService /// Normalizes a package-relative path, rejecting paths that escape the package or violate the path rules. /// /// The package-relative path to normalize. - /// Whether a trailing slash, used for directory entries, is permitted. + /// Whether a trailing slash, used for directory entries, is permitted. /// An containing either the normalized path, or an error. - private Result NormalizeRelativePath(string path, bool allowTrailingSlash = false) + private Result NormalizeRelativePath(string path, bool shouldAllowTrailingSlash = false) { if (string.IsNullOrWhiteSpace(path) || path.Length > 240 || path.Contains('\\') || path.Contains('\0') || path.StartsWith('/') || path.Contains("//")) return PackageInvalid("The theme contains an invalid path."); - string candidate = allowTrailingSlash ? path.TrimEnd('/') : path; + string candidate = shouldAllowTrailingSlash ? path.TrimEnd('/') : path; if (string.IsNullOrWhiteSpace(candidate)) return PackageInvalid("The theme contains an invalid path."); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Common/ErrorViewDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Common/ErrorViewDto.cs index 2790c5b0..e8b50622 100644 --- a/src/Lumina.Presentation.Web/Common/DTO/Common/ErrorViewDto.cs +++ b/src/Lumina.Presentation.Web/Common/DTO/Common/ErrorViewDto.cs @@ -5,7 +5,7 @@ namespace Lumina.Presentation.Web.Common.DTO.Common; /// /// Data transfer object for the data shown on the error page. /// -[DebuggerDisplay("RequestId: {RequestId}, ShowRequestId: {ShowRequestId}")] +[DebuggerDisplay("RequestId: {RequestId}, ShouldShowRequestId: {ShouldShowRequestId}")] public class ErrorViewDto { /// @@ -16,5 +16,5 @@ public class ErrorViewDto /// /// Gets a value indicating whether the request identifier should be shown. /// - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + public bool ShouldShowRequestId => !string.IsNullOrEmpty(RequestId); } diff --git a/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponse.cs b/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponse.cs index b776c4e1..3611541b 100644 --- a/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponse.cs +++ b/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponse.cs @@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.DTO.Common; /// /// Response data transfer object for the JSON responses of the web application that do not carry a payload. /// -/// Whether the operation succeeded or not. +/// Whether the operation succeeded or not. public record SuccessResponse( - [property: JsonPropertyName("success")] bool Success + [property: JsonPropertyName("success")] bool IsSuccess ); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponseOfT.cs b/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponseOfT.cs index 70e8e767..c1cef521 100644 --- a/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponseOfT.cs +++ b/src/Lumina.Presentation.Web/Common/DTO/Common/SuccessResponseOfT.cs @@ -8,9 +8,9 @@ namespace Lumina.Presentation.Web.Common.DTO.Common; /// Response data transfer object for the JSON responses of the web application that carry a payload. /// /// The type of the payload of the response. -/// Whether the operation succeeded or not. +/// Whether the operation succeeded or not. /// The payload of the response. public record SuccessResponse( - [property: JsonPropertyName("success")] bool Success, + [property: JsonPropertyName("success")] bool IsSuccess, [property: JsonPropertyName("data")] TData? Data ); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Themes/ThemeSectionNodeDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Themes/ThemeSectionNodeDto.cs index 7fbc3876..da284cff 100644 --- a/src/Lumina.Presentation.Web/Common/DTO/Themes/ThemeSectionNodeDto.cs +++ b/src/Lumina.Presentation.Web/Common/DTO/Themes/ThemeSectionNodeDto.cs @@ -9,11 +9,11 @@ namespace Lumina.Presentation.Web.Common.DTO.Themes; /// Data transfer object for a conditional or repeating section in a theme template. /// /// The property path expression that controls the section. -/// Whether the section renders when the resolved value is falsy instead of truthy. +/// Whether the section renders when the resolved value is falsy instead of truthy. /// The template nodes rendered when the section is active. [DebuggerDisplay("Expression: {Expression}")] public sealed record ThemeSectionNodeDto( string Expression, - bool Inverted, + bool IsInverted, IReadOnlyList Children ) : ThemeTemplateNodeDto; diff --git a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs index 6319e090..8ba7aa2d 100644 --- a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs +++ b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequest.cs @@ -8,9 +8,9 @@ namespace Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Directori /// Represents a request to get the directories of a file system path. /// /// The file system path for which to get the directories. Required. -/// Whether to include hidden file system elements or not. Optional. +/// Whether to include hidden file system elements or not. Optional. [DebuggerDisplay("Path: {Path}")] public record GetDirectoriesRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetFilesRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetFilesRequest.cs index 0448d103..2ac7cdf1 100644 --- a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetFilesRequest.cs +++ b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetFilesRequest.cs @@ -8,9 +8,9 @@ namespace Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Files; /// Represents a request to get the files at a file system path. /// /// The file system path for which to get the files. Required. -/// Whether to include hidden file system elements or not. Optional. +/// Whether to include hidden file system elements or not. Optional. [DebuggerDisplay("Path: {Path}")] public record GetFilesRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs index f78a9dcc..f08b0c47 100644 --- a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs +++ b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Files/GetTreeFilesRequest.cs @@ -8,9 +8,9 @@ namespace Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Files; /// Represents a request to get the files of a file system path. /// /// The file system path for which to get the tree files. Required. -/// Whether to include hidden file system elements or not. Optional. +/// Whether to include hidden file system elements or not. Optional. [DebuggerDisplay("Path: {Path}")] public record GetTreeFilesRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs index 78fb23a8..98ec593a 100644 --- a/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs +++ b/src/Lumina.Presentation.Web/Common/Requests/FileSystemManagement/Path/CheckPathExistsRequest.cs @@ -8,9 +8,9 @@ namespace Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Path; /// Represents a request to check the existence of a file system path. /// /// The file system path to check the exitence of. Required. -/// Whether to include hidden elements in the search results, or not. Optional. -[DebuggerDisplay("Path: {Path}, IncludeHiddenElements: {IncludeHiddenElements}")] +/// Whether to include hidden elements in the search results, or not. Optional. +[DebuggerDisplay("Path: {Path}, ShouldIncludeHiddenElements: {ShouldIncludeHiddenElements}")] public record CheckPathExistsRequest( string? Path, - bool IncludeHiddenElements + bool ShouldIncludeHiddenElements ); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpoint.cs index 4ef4680a..af667caf 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpoint.cs @@ -49,7 +49,7 @@ public class GetDirectoriesEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetDirectoriesRequest request, CancellationToken cancellationToken) { - DirectoryDto[] response = await _apiHttpClient.GetAsync($"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false); + DirectoryDto[] response = await _apiHttpClient.GetAsync($"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointSummary.cs index 39adb453..65e9840e 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointSummary.cs @@ -24,11 +24,11 @@ public class GetDirectoriesEndpointSummary : Summary r.Path, "The file system path for which to get the directories. Required."); - RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional."); + RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden file system elements or not. Optional."); ExampleRequest = new GetDirectoriesRequest( Path: "/media/movies/", - IncludeHiddenElements: true + ShouldIncludeHiddenElements: true ); Response(200, "The directories of the file system path are returned.", example: new SuccessResponse(true, default)); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpoint.cs index 3339abf9..14dfc99f 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpoint.cs @@ -49,7 +49,7 @@ public class GetFilesEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetFilesRequest request, CancellationToken cancellationToken) { - FileDto[] response = await _apiHttpClient.GetAsync($"{ApiRoutes.Files.GET_FILES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false); + FileDto[] response = await _apiHttpClient.GetAsync($"{ApiRoutes.Files.GET_FILES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointSummary.cs index db6da811..6b3d32e1 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointSummary.cs @@ -24,11 +24,11 @@ public class GetFilesEndpointSummary : Summary r.Path, "The file system path for which to get the files. Required."); - RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional."); + RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden file system elements or not. Optional."); ExampleRequest = new GetFilesRequest( Path: "/media/movies/", - IncludeHiddenElements: true + ShouldIncludeHiddenElements: true ); Response(200, "The files of the file system path are returned.", example: new SuccessResponse(true, default)); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpoint.cs index 983877ef..d70901d3 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpoint.cs @@ -49,7 +49,7 @@ public class GetTreeFilesEndpoint : BaseEndpoint /// Cancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetTreeFilesRequest request, CancellationToken cancellationToken) { - FileSystemTreeNodeDto[] response = await _apiHttpClient.GetAsync($"{ApiRoutes.Files.GET_TREE_FILES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false); + FileSystemTreeNodeDto[] response = await _apiHttpClient.GetAsync($"{ApiRoutes.Files.GET_TREE_FILES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointSummary.cs index abe588aa..5973ab9b 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointSummary.cs @@ -24,11 +24,11 @@ public class GetTreeFilesEndpointSummary : Summary r.Path, "The file system path for which to get the tree files. Required."); - RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden file system elements or not. Optional."); + RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden file system elements or not. Optional."); ExampleRequest = new GetTreeFilesRequest( Path: "/media/movies/", - IncludeHiddenElements: true + ShouldIncludeHiddenElements: true ); Response(200, "The file system tree of the file system path is returned.", example: new SuccessResponse(true, default)); diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpoint.cs index db41a478..1f958c6f 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpoint.cs @@ -49,7 +49,7 @@ public class CheckPathExistsEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(CheckPathExistsRequest request, CancellationToken cancellationToken) { - PathExistsDto response = await _apiHttpClient.GetAsync($"{ApiRoutes.Path.CHECK_PATH_EXISTS}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements={request.IncludeHiddenElements}", cancellationToken).ConfigureAwait(false); + PathExistsDto response = await _apiHttpClient.GetAsync($"{ApiRoutes.Path.CHECK_PATH_EXISTS}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements={request.ShouldIncludeHiddenElements}", cancellationToken).ConfigureAwait(false); return JsonSuccess(new { exists = response.Exists }); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointSummary.cs index edb14f0e..1a2549df 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointSummary.cs @@ -22,11 +22,11 @@ public class CheckPathExistsEndpointSummary : Summary r.Path, "The file system path to check the existence of. Required."); - RequestParam(r => r.IncludeHiddenElements, "Whether to include hidden elements in the search results, or not. Optional."); + RequestParam(r => r.ShouldIncludeHiddenElements, "Whether to include hidden elements in the search results, or not. Optional."); ExampleRequest = new CheckPathExistsRequest( Path: "/media/movies/", - IncludeHiddenElements: true + ShouldIncludeHiddenElements: true ); Response(200, "Whether the file system path exists is returned.", example: new { success = true, data = new { exists = true } }); diff --git a/src/Lumina.Presentation.Web/Core/Themes/ThemeTemplateEngine.cs b/src/Lumina.Presentation.Web/Core/Themes/ThemeTemplateEngine.cs index a535de9c..25d516d9 100644 --- a/src/Lumina.Presentation.Web/Core/Themes/ThemeTemplateEngine.cs +++ b/src/Lumina.Presentation.Web/Core/Themes/ThemeTemplateEngine.cs @@ -49,7 +49,7 @@ public sealed class ThemeTemplateEngine ThemeSectionNodeDto? scriptsSection = null; foreach (ThemeTemplateNodeDto node in parseResult.Value) { - if (node is ThemeSectionNodeDto { Inverted: false } section + if (node is ThemeSectionNodeDto { IsInverted: false } section && scriptsSection is null && string.Equals(section.Expression, "scripts", StringComparison.OrdinalIgnoreCase)) { @@ -146,7 +146,7 @@ public sealed class ThemeTemplateEngine if (childrenResult.IsFailure) return childrenResult.Errors; - nodes.Add(new ThemeSectionNodeDto(expression, Inverted: tag[0] == '^', Children: childrenResult.Value)); + nodes.Add(new ThemeSectionNodeDto(expression, IsInverted: tag[0] == '^', Children: childrenResult.Value)); break; } case '/': @@ -247,16 +247,16 @@ public sealed class ThemeTemplateEngine private static Result RenderSection(ThemeSectionNodeDto section, ThemeRenderScopeDto scope, StringBuilder output) { object? value = Resolve(section.Expression, scope); - bool truthy = IsTruthy(value); - if (section.Inverted) + bool isTruthy = IsTruthy(value); + if (section.IsInverted) { - if (!truthy) + if (!isTruthy) return RenderNodes(section.Children, scope, output); return Result.Success; } - if (!truthy) + if (!isTruthy) return Result.Success; if (value is bool) @@ -425,7 +425,7 @@ public sealed class ThemeTemplateEngine return value switch { null => string.Empty, - bool boolean => boolean ? "true" : "false", + bool isBoolean => isBoolean ? "true" : "false", DateTime dateTime => dateTime.ToString("O", CultureInfo.InvariantCulture), DateTimeOffset dateTimeOffset => dateTimeOffset.ToString("O", CultureInfo.InvariantCulture), IFormattable formattable => formattable.ToString(null, CultureInfo.InvariantCulture) ?? string.Empty, diff --git a/src/Lumina.Presentation.Web/Core/Views/Shared/Error.cshtml b/src/Lumina.Presentation.Web/Core/Views/Shared/Error.cshtml index 9796d49c..70efbfcf 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Shared/Error.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Shared/Error.cshtml @@ -7,7 +7,7 @@

Error.

An error occurred while processing your request.

-@if (Model.ShowRequestId) +@if (Model.ShouldShowRequestId) {

Request ID: @Model.RequestId diff --git a/src/Lumina.Presentation.Web/wwwroot/js/file-system-browser-dialog.js b/src/Lumina.Presentation.Web/wwwroot/js/file-system-browser-dialog.js index 5f24564e..e1640b12 100644 --- a/src/Lumina.Presentation.Web/wwwroot/js/file-system-browser-dialog.js +++ b/src/Lumina.Presentation.Web/wwwroot/js/file-system-browser-dialog.js @@ -263,7 +263,7 @@ if (addressBarInput.value !== null && !addressBarInput.value.endsWith(pathSeparator)) addressBarInput.value += pathSeparator; } else { - const pathExistsResponse = await callApiGetAsync(`${clientBasePath}path/api-check-path-exists?path=${encodeURIComponent(path)}&includeHiddenElements=${showHiddenElements}`); + const pathExistsResponse = await callApiGetAsync(`${clientBasePath}path/api-check-path-exists?path=${encodeURIComponent(path)}&shouldIncludeHiddenElements=${showHiddenElements}`); if (pathExistsResponse !== undefined && !pathExistsResponse.exists) { notificationService.show("Specified path does not exist!", NotificationType.ERROR); // TODO: should ask error message from server when translation is implemented return false; @@ -775,7 +775,7 @@ * @param {Function} callback - Function to call for each directory received. */ async function fetchFileSystemDirectoriesAsync(path, callback) { - await fetchJsonDataAsync(`${clientBasePath}directories/api-get-directories?path=${encodeURIComponent(path)}&includeHiddenElements=${showHiddenElements}`, callback, 'Directory'); + await fetchJsonDataAsync(`${clientBasePath}directories/api-get-directories?path=${encodeURIComponent(path)}&shouldIncludeHiddenElements=${showHiddenElements}`, callback, 'Directory'); } /** @@ -784,7 +784,7 @@ * @param {Function} callback - Function to call for each file received. */ async function fetchFileSystemFilesAsync(path, callback) { - await fetchJsonDataAsync(`${clientBasePath}files/api-get-tree-files?path=${encodeURIComponent(path)}&includeHiddenElements=${showHiddenElements}`, callback, 'File'); + await fetchJsonDataAsync(`${clientBasePath}files/api-get-tree-files?path=${encodeURIComponent(path)}&shouldIncludeHiddenElements=${showHiddenElements}`, callback, 'File'); } /** diff --git a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryFixture.cs index 2c775852..663664e7 100644 --- a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryFixture.cs +++ b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryFixture.cs @@ -18,9 +18,9 @@ public class GetDirectoriesQueryFixture /// Creates a random valid query to get directories. /// /// Optional. The file system path. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created query to get directories. - public GetDirectoriesQuery Create(string? path = null, bool includeHiddenElements = false) + public GetDirectoriesQuery Create(string? path = null, bool shouldIncludeHiddenElements = false) { return new Faker() .CustomInstantiator(f => new GetDirectoriesQuery( @@ -28,7 +28,7 @@ public class GetDirectoriesQueryFixture default )) .RuleFor(x => x.Path, f => path ?? f.System.DirectoryPath()) - .RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements); + .RuleFor(x => x.ShouldIncludeHiddenElements, f => shouldIncludeHiddenElements); } ///

diff --git a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryFixture.cs index fc1877af..19c9fcad 100644 --- a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryFixture.cs +++ b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryFixture.cs @@ -18,9 +18,9 @@ public class GetFilesQueryFixture /// Creates a random valid query to get files. /// /// Optional. The file system path. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created query to get files. - public GetFilesQuery Create(string? path = null, bool includeHiddenElements = false) + public GetFilesQuery Create(string? path = null, bool shouldIncludeHiddenElements = false) { return new Faker() .CustomInstantiator(f => new GetFilesQuery( @@ -28,7 +28,7 @@ public class GetFilesQueryFixture default )) .RuleFor(x => x.Path, f => path ?? f.System.FilePath()) - .RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements); + .RuleFor(x => x.ShouldIncludeHiddenElements, f => shouldIncludeHiddenElements); } /// diff --git a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryFixture.cs index 195ee6ee..a4b52be9 100644 --- a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryFixture.cs +++ b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryFixture.cs @@ -18,9 +18,9 @@ public class GetTreeFilesQueryFixture /// Creates a random valid query to get tree files. /// /// Optional. The file system path. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created query to get tree files. - public GetTreeFilesQuery Create(string? path = null, bool includeHiddenElements = false) + public GetTreeFilesQuery Create(string? path = null, bool shouldIncludeHiddenElements = false) { return new Faker() .CustomInstantiator(f => new GetTreeFilesQuery( @@ -28,7 +28,7 @@ public class GetTreeFilesQueryFixture default )) .RuleFor(x => x.Path, f => path ?? f.System.FilePath()) - .RuleFor(x => x.IncludeHiddenElements, f => includeHiddenElements); + .RuleFor(x => x.ShouldIncludeHiddenElements, f => shouldIncludeHiddenElements); } /// diff --git a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryFixture.cs index 0fc9910a..008ab95b 100644 --- a/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryFixture.cs +++ b/tests/Common/Lumina.Application.Fixtures/Core/FileSystemManagement/Paths/Queries/CheckPathExists/CheckPathExistsQueryFixture.cs @@ -18,9 +18,9 @@ public class CheckPathExistsQueryFixture /// Creates a random valid query to check if paths exist. /// /// Optional. The file system path. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created query. - public CheckPathExistsQuery Create(string? path = null, bool includeHiddenElements = true) + public CheckPathExistsQuery Create(string? path = null, bool shouldIncludeHiddenElements = true) { return new Faker() .CustomInstantiator(f => new CheckPathExistsQuery( @@ -28,7 +28,7 @@ public class CheckPathExistsQueryFixture default )) .RuleFor(x => x.Path, f => path ?? f.System.FilePath()) - .RuleFor(x => x.IncludeHiddenElements, includeHiddenElements); + .RuleFor(x => x.ShouldIncludeHiddenElements, shouldIncludeHiddenElements); } /// diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs index 683ac580..a46e3d27 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs @@ -20,15 +20,15 @@ public class GetDirectoriesRequestFixture /// Creates a with default or random values. /// /// Optional. The file system path for which to get the directories. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created . public GetDirectoriesRequest Create( string? path = null, - bool? includeHiddenElements = null) + bool? shouldIncludeHiddenElements = null) { return new GetDirectoriesRequest( Path: path ?? _faker.System.FilePath(), - IncludeHiddenElements: includeHiddenElements ?? _faker.Random.Bool() + ShouldIncludeHiddenElements: shouldIncludeHiddenElements ?? _faker.Random.Bool() ); } diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetFilesRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetFilesRequestFixture.cs index aa139a6d..2fed66cf 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetFilesRequestFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetFilesRequestFixture.cs @@ -20,15 +20,15 @@ public class GetFilesRequestFixture /// Creates a with default or random values. /// /// Optional. The file system path for which to get the files. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created . public GetFilesRequest Create( string? path = null, - bool? includeHiddenElements = null) + bool? shouldIncludeHiddenElements = null) { return new GetFilesRequest( Path: path ?? _faker.System.FilePath(), - IncludeHiddenElements: includeHiddenElements ?? _faker.Random.Bool() + ShouldIncludeHiddenElements: shouldIncludeHiddenElements ?? _faker.Random.Bool() ); } diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetTreeFilesRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetTreeFilesRequestFixture.cs index 6f5c67d2..ff79cf3f 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetTreeFilesRequestFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Files/GetTreeFilesRequestFixture.cs @@ -20,15 +20,15 @@ public class GetTreeFilesRequestFixture /// Creates a with default or random values. /// /// Optional. The file system path for which to get the tree files. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created . public GetTreeFilesRequest Create( string? path = null, - bool? includeHiddenElements = null) + bool? shouldIncludeHiddenElements = null) { return new GetTreeFilesRequest( Path: path ?? _faker.System.FilePath(), - IncludeHiddenElements: includeHiddenElements ?? _faker.Random.Bool() + ShouldIncludeHiddenElements: shouldIncludeHiddenElements ?? _faker.Random.Bool() ); } diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Path/CheckPathExistsRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Path/CheckPathExistsRequestFixture.cs index 41682d4b..be4ce76b 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Path/CheckPathExistsRequestFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/FileSystemManagement/Path/CheckPathExistsRequestFixture.cs @@ -20,15 +20,15 @@ public class CheckPathExistsRequestFixture /// Creates a with default or random values. /// /// Optional. The path to check. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// The created . public CheckPathExistsRequest Create( string? path = null, - bool? includeHiddenElements = null) + bool? shouldIncludeHiddenElements = null) { return new CheckPathExistsRequest( Path: path ?? _faker.System.FilePath(), - IncludeHiddenElements: includeHiddenElements ?? _faker.Random.Bool() + ShouldIncludeHiddenElements: shouldIncludeHiddenElements ?? _faker.Random.Bool() ); } diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs index 6c3c7575..daf3c6d6 100644 --- a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/FileSystemManagement/Directories/GetDirectoriesRequestFixture.cs @@ -17,15 +17,15 @@ public class GetDirectoriesRequestFixture /// Creates a new instance with randomized test data. /// /// Optional file system path whose directories are retrieved. - /// Whether to include hidden file system elements or not. + /// Whether to include hidden file system elements or not. /// A configured instance. public GetDirectoriesRequest Create( string? path = null, - bool includeHiddenElements = false) + bool shouldIncludeHiddenElements = false) { return new GetDirectoriesRequest( Path: path ?? $"/media/{System.Guid.NewGuid():N}", - IncludeHiddenElements: includeHiddenElements + ShouldIncludeHiddenElements: shouldIncludeHiddenElements ); } diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs index 543c9b9f..fff048ee 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs @@ -40,10 +40,10 @@ public class GetDirectoriesEndpointTests : IClassFixture _apiFactory.ApiClientStub.Reset(); string path = @"C:\Users\test"; DirectoryDto[] expectedDirectories = [_directoryDtoFixture.Create(path: path, name: "test")]; - string expectedEndpoint = $"directories/get-directories?path={Uri.EscapeDataString(path)}&includeHiddenElements=True"; + string expectedEndpoint = $"directories/get-directories?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=True"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, expectedDirectories); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/directories/api-get-directories?path={Uri.EscapeDataString(path)}&includeHiddenElements=true"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/directories/api-get-directories?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=true"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs index bd562e06..4af4fb92 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs @@ -40,10 +40,10 @@ public class GetFilesEndpointTests : IClassFixture _apiFactory.ApiClientStub.Reset(); string path = @"C:\Users\test"; FileDto[] expectedFiles = [_fileDtoFixture.Create(path: path, name: "book.pdf")]; - string expectedEndpoint = $"files/get-files?path={Uri.EscapeDataString(path)}&includeHiddenElements=True"; + string expectedEndpoint = $"files/get-files?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=True"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, expectedFiles); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/files/api-get-files?path={Uri.EscapeDataString(path)}&includeHiddenElements=true"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/files/api-get-files?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=true"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointTests.cs index 1ec83afc..3619024d 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Files/GetTreeFiles/GetTreeFilesEndpointTests.cs @@ -40,10 +40,10 @@ public class GetTreeFilesEndpointTests : IClassFixture _apiFactory.ApiClientStub.Reset(); string path = @"C:\Users\test"; FileSystemTreeNodeDto[] expectedNodes = [_fileSystemTreeNodeDtoFixture.Create(path: path, name: "test")]; - string expectedEndpoint = $"files/get-tree-files?path={Uri.EscapeDataString(path)}&includeHiddenElements=True"; + string expectedEndpoint = $"files/get-tree-files?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=True"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, expectedNodes); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/files/api-get-tree-files?path={Uri.EscapeDataString(path)}&includeHiddenElements=true"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/files/api-get-tree-files?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=true"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs index 3e95d5b2..0a1c86af 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs @@ -38,10 +38,10 @@ public class CheckPathExistsEndpointTests : IClassFixture // Arrange _apiFactory.ApiClientStub.Reset(); string path = @"C:\Users\test"; - string expectedEndpoint = $"path/check-path-exists?path={Uri.EscapeDataString(path)}&includeHiddenElements=True"; + string expectedEndpoint = $"path/check-path-exists?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=True"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, _pathExistsDtoFixture.Create(exists: true)); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/path/api-check-path-exists?path={Uri.EscapeDataString(path)}&includeHiddenElements=true"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/path/api-check-path-exists?path={Uri.EscapeDataString(path)}&shouldIncludeHiddenElements=true"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs index 0ac6b729..836b10a2 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs @@ -50,10 +50,10 @@ public class GetDirectoriesEndpointTests : IClassFixture { // Arrange _apiFactory.ApiClientStub.Reset(); - string expectedEndpoint = $"directories/get-directories?path={Uri.EscapeDataString(maliciousPath)}&includeHiddenElements=False"; + string expectedEndpoint = $"directories/get-directories?path={Uri.EscapeDataString(maliciousPath)}&shouldIncludeHiddenElements=False"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, Array.Empty()); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/directories/api-get-directories?path={Uri.EscapeDataString(maliciousPath)}&includeHiddenElements=false"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/directories/api-get-directories?path={Uri.EscapeDataString(maliciousPath)}&shouldIncludeHiddenElements=false"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs index c34cfae1..6dc38ea1 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Files/GetFiles/GetFilesEndpointTests.cs @@ -50,10 +50,10 @@ public class GetFilesEndpointTests : IClassFixture { // Arrange _apiFactory.ApiClientStub.Reset(); - string expectedEndpoint = $"files/get-files?path={Uri.EscapeDataString(maliciousPath)}&includeHiddenElements=False"; + string expectedEndpoint = $"files/get-files?path={Uri.EscapeDataString(maliciousPath)}&shouldIncludeHiddenElements=False"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, Array.Empty()); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/files/api-get-files?path={Uri.EscapeDataString(maliciousPath)}&includeHiddenElements=false"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/files/api-get-files?path={Uri.EscapeDataString(maliciousPath)}&shouldIncludeHiddenElements=false"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs index c24e173c..d2a5f9cb 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/FileSystemManagement/Path/CheckPathExists/CheckPathExistsEndpointTests.cs @@ -51,10 +51,10 @@ public class CheckPathExistsEndpointTests : IClassFixture { // Arrange _apiFactory.ApiClientStub.Reset(); - string expectedEndpoint = $"path/check-path-exists?path={Uri.EscapeDataString(maliciousPath)}&includeHiddenElements=False"; + string expectedEndpoint = $"path/check-path-exists?path={Uri.EscapeDataString(maliciousPath)}&shouldIncludeHiddenElements=False"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, _pathExistsDtoFixture.Create()); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); - HttpRequestMessage getRequest = new(HttpMethod.Get, $"/path/api-check-path-exists?path={Uri.EscapeDataString(maliciousPath)}&includeHiddenElements=false"); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/path/api-check-path-exists?path={Uri.EscapeDataString(maliciousPath)}&shouldIncludeHiddenElements=false"); getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // Act diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMappingTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMappingTests.cs index 1e12bef4..6f6df435 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMappingTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Directories/GetDirectoriesRequestMappingTests.cs @@ -28,6 +28,6 @@ public class GetDirectoriesRequestMappingTests // Assert Assert.NotNull(result); Assert.Equal(request.Path, result.Path); - Assert.Equal(request.IncludeHiddenElements, result.IncludeHiddenElements); + Assert.Equal(request.ShouldIncludeHiddenElements, result.ShouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMappingTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMappingTests.cs index aafecb2d..69c7e5bb 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMappingTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetFilesRequestMappingTests.cs @@ -28,6 +28,6 @@ public class GetFilesRequestMappingTests // Assert Assert.NotNull(result); Assert.Equal(request.Path, result.Path); - Assert.Equal(request.IncludeHiddenElements, result.IncludeHiddenElements); + Assert.Equal(request.ShouldIncludeHiddenElements, result.ShouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMappingTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMappingTests.cs index 41644ab7..24301f3d 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMappingTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Files/GetTreeFilesRequestMappingTests.cs @@ -28,6 +28,6 @@ public class GetTreeFilesRequestMappingTests // Assert Assert.NotNull(result); Assert.Equal(request.Path, result.Path); - Assert.Equal(request.IncludeHiddenElements, result.IncludeHiddenElements); + Assert.Equal(request.ShouldIncludeHiddenElements, result.ShouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMappingTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMappingTests.cs index 2ee1b6ab..0cc417ea 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMappingTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Common/Mapping/FileSystemManagement/Paths/CheckPathExistsRequestMappingTests.cs @@ -30,17 +30,17 @@ public class CheckPathExistsRequestMappingTests // Assert Assert.NotNull(result); Assert.Equal(request.Path, result.Path); - Assert.Equal(request.IncludeHiddenElements, result.IncludeHiddenElements); + Assert.Equal(request.ShouldIncludeHiddenElements, result.ShouldIncludeHiddenElements); } [Theory] [InlineData("/home/user/documents", true)] [InlineData("C:\\Users\\Documents", false)] [InlineData("/var/www/html", true)] - public void ToQuery_WhenMappingWithDifferentPathsAndHiddenElementsFlag_ShouldMapCorrectly(string path, bool includeHiddenElements) + public void ToQuery_WhenMappingWithDifferentPathsAndHiddenElementsFlag_ShouldMapCorrectly(string path, bool shouldIncludeHiddenElements) { // Arrange - CheckPathExistsRequest request = new(path, includeHiddenElements); + CheckPathExistsRequest request = new(path, shouldIncludeHiddenElements); // Act CheckPathExistsQuery result = request.ToQuery(); @@ -48,7 +48,7 @@ public class CheckPathExistsRequestMappingTests // Assert Assert.NotNull(result); Assert.Equal(path, result.Path); - Assert.Equal(includeHiddenElements, result.IncludeHiddenElements); + Assert.Equal(shouldIncludeHiddenElements, result.ShouldIncludeHiddenElements); } [Fact] @@ -66,7 +66,7 @@ public class CheckPathExistsRequestMappingTests for (int i = 0; i < requests.Count; i++) { Assert.Equal(requests[i].Path, results[i].Path); - Assert.Equal(requests[i].IncludeHiddenElements, results[i].IncludeHiddenElements); + Assert.Equal(requests[i].ShouldIncludeHiddenElements, results[i].ShouldIncludeHiddenElements); } } } diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandlerTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandlerTests.cs index 0efb2263..1ce93265 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandlerTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Directories/Queries/GetDirectories/GetDirectoriesQueryHandlerTests.cs @@ -49,11 +49,11 @@ public class GetDirectoriesQueryHandlerTests public async Task HandleAsync_WhenCalledWithValidQueryWithoutFilesIncluded_ShouldReturnSuccessResult() { // Arrange - GetDirectoriesQuery getDirectoriesQuery = _getDirectoriesQueryFixture.Create(includeHiddenElements: false); + GetDirectoriesQuery getDirectoriesQuery = _getDirectoriesQueryFixture.Create(shouldIncludeHiddenElements: false); IEnumerable directories = _directoryFixture.CreateMany(); - _mockDirectoryService.GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.IncludeHiddenElements) + _mockDirectoryService.GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.ShouldIncludeHiddenElements) .Returns(Result.From(directories)); // Act @@ -76,18 +76,18 @@ public class GetDirectoriesQueryHandlerTests Assert.Empty(resultList[i].Items); // since files are not included } - _mockDirectoryService.Received(1).GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.IncludeHiddenElements); + _mockDirectoryService.Received(1).GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.ShouldIncludeHiddenElements); } [Fact] public async Task HandleAsync_WhenCalledWithValidQueryWithFilesIncluded_ShouldReturnSuccessResult() { // Arrange - GetDirectoriesQuery getDirectoriesQuery = _getDirectoriesQueryFixture.Create(includeHiddenElements: true); + GetDirectoriesQuery getDirectoriesQuery = _getDirectoriesQueryFixture.Create(shouldIncludeHiddenElements: true); IEnumerable directories = _directoryFixture.CreateMany(); - _mockDirectoryService.GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.IncludeHiddenElements) + _mockDirectoryService.GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.ShouldIncludeHiddenElements) .Returns(Result.From(directories)); // Act @@ -110,7 +110,7 @@ public class GetDirectoriesQueryHandlerTests Assert.Equal(directoriesList[i].Items.Count, resultList[i].Items.Count); } - _mockDirectoryService.Received(1).GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.IncludeHiddenElements); + _mockDirectoryService.Received(1).GetSubdirectories(getDirectoriesQuery.Path!, getDirectoriesQuery.ShouldIncludeHiddenElements); } [Fact] @@ -119,7 +119,7 @@ public class GetDirectoriesQueryHandlerTests // Arrange GetDirectoriesQuery query = _getDirectoriesQueryFixture.Create(); Error error = Error.Failure("DirectoryService.Error", "An error occurred"); - _mockDirectoryService.GetSubdirectories(query.Path!, query.IncludeHiddenElements) + _mockDirectoryService.GetSubdirectories(query.Path!, query.ShouldIncludeHiddenElements) .Returns(error); // Act @@ -128,7 +128,7 @@ public class GetDirectoriesQueryHandlerTests // Assert Assert.True(result.IsFailure); Assert.Equal(error, result.FirstError); - _mockDirectoryService.Received(1).GetSubdirectories(query.Path!, query.IncludeHiddenElements); + _mockDirectoryService.Received(1).GetSubdirectories(query.Path!, query.ShouldIncludeHiddenElements); } [Fact] @@ -137,7 +137,7 @@ public class GetDirectoriesQueryHandlerTests // Arrange GetDirectoriesQuery query = _getDirectoriesQueryFixture.Create(); Result> emptyList = Result.From(Enumerable.Empty()); - _mockDirectoryService.GetSubdirectories(query.Path!, query.IncludeHiddenElements) + _mockDirectoryService.GetSubdirectories(query.Path!, query.ShouldIncludeHiddenElements) .Returns(emptyList); // Act @@ -146,6 +146,6 @@ public class GetDirectoriesQueryHandlerTests // Assert Assert.False(result.IsFailure); Assert.Empty(result.Value); - _mockDirectoryService.Received(1).GetSubdirectories(query.Path!, query.IncludeHiddenElements); + _mockDirectoryService.Received(1).GetSubdirectories(query.Path!, query.ShouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandlerTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandlerTests.cs index 0ffcb560..019d00b5 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandlerTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetFiles/GetFilesQueryHandlerTests.cs @@ -49,11 +49,11 @@ public class GetFilesQueryHandlerTests public async Task HandleAsync_WhenCalledWithValidQueryWithoutHiddenFiles_ShouldReturnSuccessResult() { // Arrange - GetFilesQuery getFilesQuery = _getFilesQueryFixture.Create(includeHiddenElements: false); + GetFilesQuery getFilesQuery = _getFilesQueryFixture.Create(shouldIncludeHiddenElements: false); IEnumerable files = _fileFixture.CreateMany(); - _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements) + _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements) .Returns(Result.From(files)); // Act @@ -76,18 +76,18 @@ public class GetFilesQueryHandlerTests Assert.Equal(filesList[i].Size, resultList[i].Size); } - _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements); } [Fact] public async Task HandleAsync_WhenCalledWithValidQueryWithHiddenFiles_ShouldReturnSuccessResult() { // Arrange - GetFilesQuery getFilesQuery = _getFilesQueryFixture.Create(includeHiddenElements: true); + GetFilesQuery getFilesQuery = _getFilesQueryFixture.Create(shouldIncludeHiddenElements: true); IEnumerable files = _fileFixture.CreateMany(); - _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements) + _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements) .Returns(Result.From(files)); // Act @@ -110,7 +110,7 @@ public class GetFilesQueryHandlerTests Assert.Equal(filesList[i].Size, resultList[i].Size); } - _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements); } [Fact] @@ -119,7 +119,7 @@ public class GetFilesQueryHandlerTests // Arrange GetFilesQuery query = _getFilesQueryFixture.Create(); Error error = Error.Failure("FileService.Error", "An error occurred"); - _mockFileService.GetFiles(query.Path!, query.IncludeHiddenElements) + _mockFileService.GetFiles(query.Path!, query.ShouldIncludeHiddenElements) .Returns(error); // Act @@ -128,7 +128,7 @@ public class GetFilesQueryHandlerTests // Assert Assert.True(result.IsFailure); Assert.Equal(error, result.FirstError); - _mockFileService.Received(1).GetFiles(query.Path!, query.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(query.Path!, query.ShouldIncludeHiddenElements); } [Fact] @@ -137,7 +137,7 @@ public class GetFilesQueryHandlerTests // Arrange GetFilesQuery query = _getFilesQueryFixture.Create(); Result> emptyList = Result.From(Enumerable.Empty()); - _mockFileService.GetFiles(query.Path!, query.IncludeHiddenElements) + _mockFileService.GetFiles(query.Path!, query.ShouldIncludeHiddenElements) .Returns(emptyList); // Act @@ -146,6 +146,6 @@ public class GetFilesQueryHandlerTests // Assert Assert.False(result.IsFailure); Assert.Empty(result.Value); - _mockFileService.Received(1).GetFiles(query.Path!, query.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(query.Path!, query.ShouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandlerTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandlerTests.cs index 8d0809db..b237d0ee 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandlerTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Core/FileSystemManagement/Files/Queries/GetTreeFiles/GetTreeFilesQueryHandlerTests.cs @@ -49,11 +49,11 @@ public class GetTreeFilesQueryHandlerTests public async Task HandleAsync_WhenCalledWithValidQueryWithoutHiddenFiles_ShouldReturnSuccessResult() { // Arrange - GetTreeFilesQuery getFilesQuery = _getTreeFilesQueryFixture.Create(includeHiddenElements: false); + GetTreeFilesQuery getFilesQuery = _getTreeFilesQueryFixture.Create(shouldIncludeHiddenElements: false); IEnumerable files = _fileFixture.CreateMany(); - _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements) + _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements) .Returns(Result.From(files)); // Act @@ -77,18 +77,18 @@ public class GetTreeFilesQueryHandlerTests Assert.Empty(resultList[i].Children); } - _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements); } [Fact] public async Task HandleAsync_WhenCalledWithValidQueryWithHiddenFiles_ShouldReturnSuccessResult() { // Arrange - GetTreeFilesQuery getFilesQuery = _getTreeFilesQueryFixture.Create(includeHiddenElements: true); + GetTreeFilesQuery getFilesQuery = _getTreeFilesQueryFixture.Create(shouldIncludeHiddenElements: true); IEnumerable files = _fileFixture.CreateMany(); - _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements) + _mockFileService.GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements) .Returns(Result.From(files)); // Act @@ -112,7 +112,7 @@ public class GetTreeFilesQueryHandlerTests Assert.Empty(resultList[i].Children); } - _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(getFilesQuery.Path!, getFilesQuery.ShouldIncludeHiddenElements); } [Fact] @@ -121,7 +121,7 @@ public class GetTreeFilesQueryHandlerTests // Arrange GetTreeFilesQuery query = _getTreeFilesQueryFixture.Create(); Error error = Error.Failure("FileService.Error", "An error occurred"); - _mockFileService.GetFiles(query.Path!, query.IncludeHiddenElements) + _mockFileService.GetFiles(query.Path!, query.ShouldIncludeHiddenElements) .Returns(error); // Act @@ -130,7 +130,7 @@ public class GetTreeFilesQueryHandlerTests // Assert Assert.True(result.IsFailure); Assert.Equal(error, result.FirstError); - _mockFileService.Received(1).GetFiles(query.Path!, query.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(query.Path!, query.ShouldIncludeHiddenElements); } [Fact] @@ -139,7 +139,7 @@ public class GetTreeFilesQueryHandlerTests // Arrange GetTreeFilesQuery query = _getTreeFilesQueryFixture.Create(); Result> emptyList = Result.From(Enumerable.Empty()); - _mockFileService.GetFiles(query.Path!, query.IncludeHiddenElements) + _mockFileService.GetFiles(query.Path!, query.ShouldIncludeHiddenElements) .Returns(emptyList); // Act @@ -148,6 +148,6 @@ public class GetTreeFilesQueryHandlerTests // Assert Assert.False(result.IsFailure); Assert.Empty(result.Value); - _mockFileService.Received(1).GetFiles(query.Path!, query.IncludeHiddenElements); + _mockFileService.Received(1).GetFiles(query.Path!, query.ShouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Directories/GetDirectoriesRequestTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Directories/GetDirectoriesRequestTests.cs index 5e2c5cf8..0d0679e0 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Directories/GetDirectoriesRequestTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Directories/GetDirectoriesRequestTests.cs @@ -50,13 +50,13 @@ public class GetDirectoriesRequestTests public void Deconstruct_WhenCalled_ShouldReturnAllProperties() { // Arrange - GetDirectoriesRequest sut = _getDirectoriesRequestFixture.Create(path: @"C:\Media", includeHiddenElements: true); + GetDirectoriesRequest sut = _getDirectoriesRequestFixture.Create(path: @"C:\Media", shouldIncludeHiddenElements: true); // Act - (string? path, bool includeHiddenElements) = sut; + (string? path, bool shouldIncludeHiddenElements) = sut; // Assert Assert.Equal(sut.Path, path); - Assert.Equal(sut.IncludeHiddenElements, includeHiddenElements); + Assert.Equal(sut.ShouldIncludeHiddenElements, shouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetFilesRequestTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetFilesRequestTests.cs index 1c47e9d6..203cddb9 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetFilesRequestTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetFilesRequestTests.cs @@ -50,13 +50,13 @@ public class GetFilesRequestTests public void Deconstruct_WhenCalled_ShouldReturnAllProperties() { // Arrange - GetFilesRequest sut = _getFilesRequestFixture.Create(path: @"C:\Media", includeHiddenElements: true); + GetFilesRequest sut = _getFilesRequestFixture.Create(path: @"C:\Media", shouldIncludeHiddenElements: true); // Act - (string? path, bool includeHiddenElements) = sut; + (string? path, bool shouldIncludeHiddenElements) = sut; // Assert Assert.Equal(sut.Path, path); - Assert.Equal(sut.IncludeHiddenElements, includeHiddenElements); + Assert.Equal(sut.ShouldIncludeHiddenElements, shouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetTreeFilesRequestTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetTreeFilesRequestTests.cs index cf41d6c8..2054c056 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetTreeFilesRequestTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Files/GetTreeFilesRequestTests.cs @@ -50,13 +50,13 @@ public class GetTreeFilesRequestTests public void Deconstruct_WhenCalled_ShouldReturnAllProperties() { // Arrange - GetTreeFilesRequest sut = _getTreeFilesRequestFixture.Create(path: @"C:\Media", includeHiddenElements: false); + GetTreeFilesRequest sut = _getTreeFilesRequestFixture.Create(path: @"C:\Media", shouldIncludeHiddenElements: false); // Act - (string? path, bool includeHiddenElements) = sut; + (string? path, bool shouldIncludeHiddenElements) = sut; // Assert Assert.Equal(sut.Path, path); - Assert.Equal(sut.IncludeHiddenElements, includeHiddenElements); + Assert.Equal(sut.ShouldIncludeHiddenElements, shouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Path/CheckPathExistsRequestTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Path/CheckPathExistsRequestTests.cs index d452f298..940022e8 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Path/CheckPathExistsRequestTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/Requests/FileSystemManagement/Path/CheckPathExistsRequestTests.cs @@ -50,13 +50,13 @@ public class CheckPathExistsRequestTests public void Deconstruct_WhenCalled_ShouldReturnAllProperties() { // Arrange - CheckPathExistsRequest sut = _checkPathExistsRequestFixture.Create(path: @"C:\Media\Books", includeHiddenElements: true); + CheckPathExistsRequest sut = _checkPathExistsRequestFixture.Create(path: @"C:\Media\Books", shouldIncludeHiddenElements: true); // Act - (string? path, bool includeHiddenElements) = sut; + (string? path, bool shouldIncludeHiddenElements) = sut; // Assert Assert.Equal(sut.Path, path); - Assert.Equal(sut.IncludeHiddenElements, includeHiddenElements); + Assert.Equal(sut.ShouldIncludeHiddenElements, shouldIncludeHiddenElements); } } diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/DirectoryServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/DirectoryServiceTests.cs index 4cf8069e..0a761645 100644 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/DirectoryServiceTests.cs +++ b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/DirectoryServiceTests.cs @@ -55,7 +55,7 @@ public class DirectoryServiceTests { // Arrange string path = _pathDirTest; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId pathId = _fileSystemPathIdFixture.Create(path); FileSystemPathId[] subPaths = [ @@ -63,7 +63,7 @@ public class DirectoryServiceTests _fileSystemPathIdFixture.Create(_pathDirTestSubDir2) ]; - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(subPaths.AsEnumerable())); foreach (FileSystemPathId subPath in subPaths) @@ -77,7 +77,7 @@ public class DirectoryServiceTests } // Act - Result> result = _sut.GetSubdirectories(path, includeHiddenElements); + Result> result = _sut.GetSubdirectories(path, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -90,10 +90,10 @@ public class DirectoryServiceTests { // Arrange string invalidPath = string.Empty; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; // Act - Result> result = _sut.GetSubdirectories(invalidPath, includeHiddenElements); + Result> result = _sut.GetSubdirectories(invalidPath, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -105,14 +105,14 @@ public class DirectoryServiceTests { // Arrange string path = _pathDirTest; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId pathId = _fileSystemPathIdFixture.Create(path); - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, shouldIncludeHiddenElements) .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetSubdirectories(path, includeHiddenElements); + Result> result = _sut.GetSubdirectories(path, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -124,13 +124,13 @@ public class DirectoryServiceTests { // Arrange string path = _pathDirTest; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId pathId = _fileSystemPathIdFixture.Create(path); FileSystemPathId subPath = _fileSystemPathIdFixture.Create( s_isUnix ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub" ); - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(new[] { subPath }.AsEnumerable())); _mockEnvironmentContext.DirectoryProviderService.GetFileName(subPath) @@ -141,7 +141,7 @@ public class DirectoryServiceTests .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetSubdirectories(path, includeHiddenElements); + Result> result = _sut.GetSubdirectories(path, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -154,14 +154,14 @@ public class DirectoryServiceTests { // Arrange Directory parentDirectory = _directoryFixture.Create(); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId[] subPaths = [ _fileSystemPathIdFixture.Create(_pathDirTestSubDir1), _fileSystemPathIdFixture.Create(_pathDirTestSubDir2) ]; - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, shouldIncludeHiddenElements) .Returns(Result.From(subPaths.AsEnumerable())); foreach (FileSystemPathId subPath in subPaths) @@ -175,7 +175,7 @@ public class DirectoryServiceTests } // Act - Result> result = _sut.GetSubdirectories(parentDirectory, includeHiddenElements); + Result> result = _sut.GetSubdirectories(parentDirectory, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -188,13 +188,13 @@ public class DirectoryServiceTests { // Arrange Directory parentDirectory = _directoryFixture.Create(); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, shouldIncludeHiddenElements) .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetSubdirectories(parentDirectory, includeHiddenElements); + Result> result = _sut.GetSubdirectories(parentDirectory, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -206,12 +206,12 @@ public class DirectoryServiceTests { // Arrange Directory parentDirectory = _directoryFixture.Create(); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId subPath = _fileSystemPathIdFixture.Create( s_isUnix ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub" ); - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(parentDirectory.Id, shouldIncludeHiddenElements) .Returns(Result.From(new[] { subPath }.AsEnumerable())); _mockEnvironmentContext.DirectoryProviderService.GetFileName(subPath) @@ -222,7 +222,7 @@ public class DirectoryServiceTests .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetSubdirectories(parentDirectory, includeHiddenElements); + Result> result = _sut.GetSubdirectories(parentDirectory, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -235,14 +235,14 @@ public class DirectoryServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathDirTest); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId[] subPaths = [ _fileSystemPathIdFixture.Create(_pathDirTestSubDir1), _fileSystemPathIdFixture.Create(_pathDirTestSubDir2) ]; - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(subPaths.AsEnumerable())); foreach (FileSystemPathId subPath in subPaths) @@ -256,7 +256,7 @@ public class DirectoryServiceTests } // Act - Result> result = _sut.GetSubdirectories(pathId, includeHiddenElements); + Result> result = _sut.GetSubdirectories(pathId, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -269,13 +269,13 @@ public class DirectoryServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathDirTest); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, shouldIncludeHiddenElements) .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetSubdirectories(pathId, includeHiddenElements); + Result> result = _sut.GetSubdirectories(pathId, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -287,12 +287,12 @@ public class DirectoryServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathDirTest); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId subPath = _fileSystemPathIdFixture.Create( s_isUnix ? "/TestDir/InaccessibleSub" : @"C:\TestDir\InaccessibleSub" ); - _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, includeHiddenElements) + _mockEnvironmentContext.DirectoryProviderService.GetSubdirectoryPaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(new[] { subPath }.AsEnumerable())); _mockEnvironmentContext.DirectoryProviderService.GetFileName(subPath) @@ -303,7 +303,7 @@ public class DirectoryServiceTests .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetSubdirectories(pathId, includeHiddenElements); + Result> result = _sut.GetSubdirectories(pathId, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/FileServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/FileServiceTests.cs index a2782531..1746cb24 100644 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/FileServiceTests.cs +++ b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/FileSystemManagementBoundedContext/FileSystemManagementAggregate/Services/FileServiceTests.cs @@ -64,7 +64,7 @@ public class FileServiceTests { // Arrange string path = _pathTestDir; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId pathId = _fileSystemPathIdFixture.Create(path); FileSystemPathId[] filePaths = [ @@ -72,7 +72,7 @@ public class FileServiceTests _fileSystemPathIdFixture.Create(_pathTestDirFile2) ]; - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(filePaths.AsEnumerable())); foreach (FileSystemPathId filePath in filePaths) @@ -88,7 +88,7 @@ public class FileServiceTests } // Act - Result> result = _sut.GetFiles(path, includeHiddenElements); + Result> result = _sut.GetFiles(path, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -101,10 +101,10 @@ public class FileServiceTests { // Arrange string invalidPath = string.Empty; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; // Act - Result> result = _sut.GetFiles(invalidPath, includeHiddenElements); + Result> result = _sut.GetFiles(invalidPath, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -116,14 +116,14 @@ public class FileServiceTests { // Arrange string path = _pathTestDir; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId pathId = _fileSystemPathIdFixture.Create(path); - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetFiles(path, includeHiddenElements); + Result> result = _sut.GetFiles(path, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -135,11 +135,11 @@ public class FileServiceTests { // Arrange string path = _pathTestDir; - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId pathId = _fileSystemPathIdFixture.Create(path); FileSystemPathId filePath = _fileSystemPathIdFixture.Create(_pathTestDirInaccessible); - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(new[] { filePath }.AsEnumerable())); _mockEnvironmentContext.FileProviderService.GetFileName(filePath) @@ -152,7 +152,7 @@ public class FileServiceTests .Returns(Result.From((long?)null)); // Act - Result> result = _sut.GetFiles(path, includeHiddenElements); + Result> result = _sut.GetFiles(path, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -165,14 +165,14 @@ public class FileServiceTests { // Arrange File parentFile = _fileFixture.Create(); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId[] filePaths = [ _fileSystemPathIdFixture.Create(_pathTestDirFile1), _fileSystemPathIdFixture.Create(_pathTestDirFile2) ]; - _mockEnvironmentContext.FileProviderService.GetFilePaths(parentFile.Id, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(parentFile.Id, shouldIncludeHiddenElements) .Returns(Result.From(filePaths.AsEnumerable())); foreach (FileSystemPathId filePath in filePaths) @@ -188,7 +188,7 @@ public class FileServiceTests } // Act - Result> result = _sut.GetFiles(parentFile, includeHiddenElements); + Result> result = _sut.GetFiles(parentFile, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -201,13 +201,13 @@ public class FileServiceTests { // Arrange File parentFile = _fileFixture.Create(); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; - _mockEnvironmentContext.FileProviderService.GetFilePaths(parentFile.Id, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(parentFile.Id, shouldIncludeHiddenElements) .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetFiles(parentFile, includeHiddenElements); + Result> result = _sut.GetFiles(parentFile, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -219,10 +219,10 @@ public class FileServiceTests { // Arrange File parentFile = _fileFixture.Create(); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId filePath = _fileSystemPathIdFixture.Create(_pathTestDirInaccessible); - _mockEnvironmentContext.FileProviderService.GetFilePaths(parentFile.Id, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(parentFile.Id, shouldIncludeHiddenElements) .Returns(Result.From(new[] { filePath }.AsEnumerable())); _mockEnvironmentContext.FileProviderService.GetFileName(filePath) @@ -235,7 +235,7 @@ public class FileServiceTests .Returns(Result.From((long?)null)); // Act - Result> result = _sut.GetFiles(parentFile, includeHiddenElements); + Result> result = _sut.GetFiles(parentFile, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -248,14 +248,14 @@ public class FileServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathTestDir); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId[] filePaths = [ _fileSystemPathIdFixture.Create(_pathTestDirFile1), _fileSystemPathIdFixture.Create(_pathTestDirFile2) ]; - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(filePaths.AsEnumerable())); foreach (FileSystemPathId filePath in filePaths) @@ -271,7 +271,7 @@ public class FileServiceTests } // Act - Result> result = _sut.GetFiles(pathId, includeHiddenElements); + Result> result = _sut.GetFiles(pathId, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -284,13 +284,13 @@ public class FileServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathTestDir); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetFiles(pathId, includeHiddenElements); + Result> result = _sut.GetFiles(pathId, shouldIncludeHiddenElements); // Assert Assert.True(result.IsFailure); @@ -302,10 +302,10 @@ public class FileServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathTestDir); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId filePath = _fileSystemPathIdFixture.Create(_pathTestDirInaccessible); - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(new[] { filePath }.AsEnumerable())); _mockEnvironmentContext.FileProviderService.GetFileName(filePath) @@ -318,7 +318,7 @@ public class FileServiceTests .Returns(Result.From((long?)null)); // Act - Result> result = _sut.GetFiles(pathId, includeHiddenElements); + Result> result = _sut.GetFiles(pathId, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); @@ -331,10 +331,10 @@ public class FileServiceTests { // Arrange FileSystemPathId pathId = _fileSystemPathIdFixture.Create(_pathTestDir); - bool includeHiddenElements = false; + bool shouldIncludeHiddenElements = false; FileSystemPathId filePath = _fileSystemPathIdFixture.Create(_pathTestDirFile1); - _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, includeHiddenElements) + _mockEnvironmentContext.FileProviderService.GetFilePaths(pathId, shouldIncludeHiddenElements) .Returns(Result.From(new[] { filePath }.AsEnumerable())); _mockEnvironmentContext.FileProviderService.GetFileName(filePath) .Returns(Result.From("File1.txt")); @@ -346,7 +346,7 @@ public class FileServiceTests .Returns(Errors.Permission.UnauthorizedAccess); // Act - Result> result = _sut.GetFiles(pathId, includeHiddenElements); + Result> result = _sut.GetFiles(pathId, shouldIncludeHiddenElements); // Assert Assert.False(result.IsFailure); diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Common/Api/ApiHttpClientTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Common/Api/ApiHttpClientTests.cs index 72e3e1a8..c6998bf6 100644 --- a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Common/Api/ApiHttpClientTests.cs +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Common/Api/ApiHttpClientTests.cs @@ -111,7 +111,7 @@ public class ApiHttpClientTests SuccessResponse result = await sut.PostAsync("auth/login", new { username = "testuser" }, CancellationToken.None); // Assert - Assert.True(result.Success); + Assert.True(result.IsSuccess); Assert.Equal(HttpMethod.Post, messageHandler.Requests[0].Method); Assert.Equal("http://localhost:5214/api/v1/auth/login", messageHandler.Requests[0].RequestUri!.ToString()); Assert.Contains("testuser", messageHandler.RequestBodies[0]); diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs index cd7c6294..49ede696 100644 --- a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/FileSystemManagement/Directories/GetDirectories/GetDirectoriesEndpointTests.cs @@ -43,7 +43,7 @@ public class GetDirectoriesEndpointTests public async Task ExecuteAsync_WhenApiReturnsDirectories_ShouldReturnSuccessJsonWithDirectories() { // Arrange - GetDirectoriesRequest request = _getDirectoriesRequestFixture.Create(path: "/media", includeHiddenElements: true); + GetDirectoriesRequest request = _getDirectoriesRequestFixture.Create(path: "/media", shouldIncludeHiddenElements: true); DirectoryDto[] expectedDirectories = [_directoryDtoFixture.Create(path: "/media/books", name: "books")]; _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) .Returns(expectedDirectories); @@ -53,7 +53,7 @@ public class GetDirectoriesEndpointTests string body = await JsonResultTestHelper.GetResponseBodyAsync(result); // Assert - string expectedEndpoint = $"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements=True"; + string expectedEndpoint = $"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements=True"; await _mockApiHttpClient.Received(1).GetAsync(expectedEndpoint, Arg.Any()); using JsonDocument jsonDocument = JsonDocument.Parse(body); Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); @@ -64,7 +64,7 @@ public class GetDirectoriesEndpointTests public async Task ExecuteAsync_WhenCalledWithoutHiddenElements_ShouldRequestWithoutHiddenElementsFlag() { // Arrange - GetDirectoriesRequest request = _getDirectoriesRequestFixture.Create(path: "/media", includeHiddenElements: false); + GetDirectoriesRequest request = _getDirectoriesRequestFixture.Create(path: "/media", shouldIncludeHiddenElements: false); _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) .Returns([]); @@ -72,7 +72,7 @@ public class GetDirectoriesEndpointTests await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - string expectedEndpoint = $"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&includeHiddenElements=False"; + string expectedEndpoint = $"{ApiRoutes.Directories.GET_DIRECTORIES}?path={Uri.EscapeDataString(request.Path!)}&shouldIncludeHiddenElements=False"; await _mockApiHttpClient.Received(1).GetAsync(expectedEndpoint, Arg.Any()); } }