Fixes typos and replaces LINQ conversions with collection expressions

This commit is contained in:
BinaryAlley committed 2026-08-09 00:19:28 -07:00
1 parent adadec7f3b
commit 74e9030a18
75 files changed
+113 -113

No files matched your search

+2 -1
View File
@@ -28,7 +28,8 @@ For those with technical curiosities, here are some goodies to browse through:
3. [3.1 Component Web Client diagram](./docs/technical/architecture/3.1%20component-web-client-diagram.svg)
4. [3.2 Component API Server diagram](./docs/technical/architecture/3.2%20component-api-server-diagram.svg)
5. [4.1 Code media library scanning diagram](./docs/technical/architecture/4.1%20code-media-library-scanning-diagram.svg)
- Also for Software Architects, you might want to take a look at the Architecture Decision Log, where you may find important stories from the past of Lumina's development, like [this one](./docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decission-record-0001.md), and others like it.
- Also for Software Architects, you might want to take a look at the Architecture Decision Log, where you may find important stories from the past of Lumina's development, like [this one](./docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0001.md), and others like it.
## Contributing
Lumina welcomes community contributions. All forms of input, be it code, bug reports, or feature suggestions, are appreciated. Be sure to read the [guidelines](./docs/CONTRIBUTING.md) for contributing first!
@@ -20,6 +20,6 @@ public interface IDomainEventsQueue
/// </summary>
/// <param name="domainEvent">When this method returns, contains the domain event removed from the queue, or the default value of <see cref="IDomainEvent"/> if the queue is empty.
/// </param>
/// <returns><see langword="true"/> if a domain event was successfuly dequeued, <see langword="false"/> otherwise.</returns>
/// <returns><see langword="true"/> if a domain event was successfully dequeued, <see langword="false"/> otherwise.</returns>
bool TryDequeue(out IDomainEvent domainEvent);
}
@@ -18,7 +18,7 @@ public static class GenreDtoMapping
/// </summary>
/// <param name="dto">The DTO to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Genre"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Genre"/>, or an error message.
/// </returns>
public static ErrorOr<Genre> ToDomainEntity(this GenreDto dto)
{
@@ -41,7 +41,7 @@ public static class GenreEntityMapping
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Genre"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Genre"/>, or an error message.
/// </returns>
public static ErrorOr<Genre> ToDomainEntity(this GenreEntity repositoryEntity)
{
@@ -18,7 +18,7 @@ public static class TagDtoMapping
/// </summary>
/// <param name="dto">The DTO to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Tag"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Tag"/>, or an error message.
/// </returns>
public static ErrorOr<Tag> ToDomainEntity(this TagDto dto)
{
@@ -41,7 +41,7 @@ public static class TagEntityMapping
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Tag"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Tag"/>, or an error message.
/// </returns>
public static ErrorOr<Tag> ToDomainEntity(this TagEntity repositoryEntity)
{
@@ -30,7 +30,7 @@ public static class BookEntityMapping
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Book"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Book"/>, or an error message.
/// </returns>
public static ErrorOr<Book> ToDomainEntity(this BookEntity repositoryEntity)
{
@@ -20,7 +20,7 @@ public static class BookRatingDtoMapping
/// </summary>
/// <param name="dto">The DTO to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="BookRating"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="BookRating"/>, or an error message.
/// </returns>
public static ErrorOr<BookRating> ToDomainEntity(this BookRatingDto dto)
{
@@ -46,7 +46,7 @@ public static class BookRatingEntityMapping
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="BookRating"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="BookRating"/>, or an error message.
/// </returns>
public static ErrorOr<BookRating> ToDomainEntity(this BookRatingEntity repositoryEntity)
{
@@ -19,7 +19,7 @@ public static class IsbnDtoMapping
/// </summary>
/// <param name="dto">The DTO to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Isbn"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Isbn"/>, or an error message.
/// </returns>
public static ErrorOr<Isbn> ToDomainEntity(this IsbnDto dto)
{
@@ -42,7 +42,7 @@ public static class IsbnEntityMapping
/// </summary>
/// <param name="repositoryEntity">The repository entity to be converted.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly converted <see cref="Isbn"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully converted <see cref="Isbn"/>, or an error message.
/// </returns>
public static ErrorOr<Isbn> ToDomainEntity(this IsbnEntity repositoryEntity)
{
@@ -44,7 +44,7 @@ public class AddRoleCommandHandler : IRequestHandler<AddRoleCommand, ErrorOr<Rol
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RoleResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RoleResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<RolePermissionsResponse>> Handle(AddRoleCommand request, CancellationToken cancellationToken)
{
@@ -44,7 +44,7 @@ public class UpdateRoleCommandHandler : IRequestHandler<UpdateRoleCommand, Error
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly updated <see cref="RoleResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully updated <see cref="RoleResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<RolePermissionsResponse>> Handle(UpdateRoleCommand request, CancellationToken cancellationToken)
{
@@ -66,7 +66,7 @@ public class SetupApplicationCommandHandler : IRequestHandler<SetupApplicationCo
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RegistrationResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RegistrationResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<RegistrationResponse>> Handle(SetupApplicationCommand request, CancellationToken cancellationToken)
{
@@ -47,7 +47,7 @@ public class GetEnabledLibrariesQueryHandler : IRequestHandler<GetEnabledLibrari
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetEnabledLibrariesQuery request, CancellationToken cancellationToken)
{
@@ -63,9 +63,9 @@ public class GetEnabledLibrariesQueryHandler : IRequestHandler<GetEnabledLibrari
else
{
// for regular users, only take the libraries that belong to them
LibraryResponse[] userEnabledLibraries = getEnabledLibrariesResult.Value
LibraryResponse[] userEnabledLibraries = [.. getEnabledLibrariesResult.Value
.Where(library => library.UserId == _currentUserService.UserId)
.Select(library => library.ToResponse()).ToArray();
.Select(library => library.ToResponse())];
return ErrorOrFactory.From(userEnabledLibraries);
}
@@ -47,7 +47,7 @@ public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, Error
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<LibraryResponse[]>> Handle(GetLibrariesQuery request, CancellationToken cancellationToken)
{
@@ -63,9 +63,9 @@ public class GetLibrariesQueryHandler : IRequestHandler<GetLibrariesQuery, Error
else
{
// for regular users, only take the libraries that belong to them
LibraryResponse[] userLibraries = getLibrariesResult.Value
LibraryResponse[] userLibraries = [.. getLibrariesResult.Value
.Where(library => library.UserId == _currentUserService.UserId)
.Select(library => library.ToResponse()).ToArray();
.Select(library => library.ToResponse())];
return ErrorOrFactory.From(userLibraries);
}
@@ -48,7 +48,7 @@ public class GetLibraryQueryHandler : IRequestHandler<GetLibraryQuery, ErrorOr<L
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<LibraryResponse>> Handle(GetLibraryQuery request, CancellationToken cancellationToken)
{
@@ -54,7 +54,7 @@ public class GetRunningLibraryScansQueryHandler : IRequestHandler<GetRunningLibr
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanProgress"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanProgress"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<IEnumerable<MediaLibraryScanProgressResponse>>> Handle(GetRunningLibraryScansQuery request, CancellationToken cancellationToken)
{
@@ -68,7 +68,7 @@ public class GetRunningLibraryScansQueryHandler : IRequestHandler<GetRunningLibr
LibraryScanEntity[] userRunningRepositoryLibraryScans = [];
// admins can see all libraries
if (!await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false))
userRunningRepositoryLibraryScans = getRunningScansResult.Value.ToArray();
userRunningRepositoryLibraryScans = [.. getRunningScansResult.Value];
else // for regular users, only take the libraries that belong to them
userRunningRepositoryLibraryScans = getRunningScansResult.Value
.Where(libraryScan => libraryScan.UserId == _currentUserService.UserId).ToArray();
@@ -45,7 +45,7 @@ public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Boo
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<BookResponse>> Handle(AddBookCommand request, CancellationToken cancellationToken)
{
@@ -67,29 +67,29 @@ public class AddBookCommandHandler : IRequestHandler<AddBookCommand, ErrorOr<Boo
Optional<BookRatingSource>.FromNullable(rating.Source.HasValue ? (BookRatingSource)(int)rating.Source : (BookRatingSource?)null),
Optional<int>.FromNullable(rating.VoteCount)));
// check if any of the results contain errors
List<Error> errors = domainRatingsResult.Where(ratingResult => ratingResult.IsError).SelectMany(ratingResult => ratingResult.Errors).ToList();
List<Error> errors = [.. domainRatingsResult.Where(ratingResult => ratingResult.IsError).SelectMany(ratingResult => ratingResult.Errors)];
if (errors.Count != 0) // if there are errors, return them
return errors;
List<BookRating> domainRatings = domainRatingsResult.Select(rating => rating.Value).ToList();
List<BookRating> domainRatings = [.. domainRatingsResult.Select(rating => rating.Value)];
List<ErrorOr<Genre>> domainGenresResult = request.Metadata!.Genres!.ConvertAll(genre => Genre.Create(genre.Name!));
errors = domainGenresResult.Where(genreResult => genreResult.IsError).SelectMany(genreResult => genreResult.Errors).ToList();
errors = [.. domainGenresResult.Where(genreResult => genreResult.IsError).SelectMany(genreResult => genreResult.Errors)];
if (errors.Count != 0)
return errors;
List<Genre> domainGenres = domainGenresResult.Select(genre => genre.Value).ToList();
List<Genre> domainGenres = [.. domainGenresResult.Select(genre => genre.Value)];
List<ErrorOr<Tag>> domainTagsResult = request.Metadata.Tags!.ConvertAll(tag => Tag.Create(tag.Name!));
errors = domainTagsResult.Where(tagResult => tagResult.IsError).SelectMany(tagResult => tagResult.Errors).ToList();
errors = [.. domainTagsResult.Where(tagResult => tagResult.IsError).SelectMany(tagResult => tagResult.Errors)];
if (errors.Count != 0)
return errors;
List<Tag> domainTags = domainTagsResult.Select(tag => tag.Value).ToList();
List<Tag> domainTags = [.. domainTagsResult.Select(tag => tag.Value)];
List<ErrorOr<Isbn>> domainIsbnsResult = request.ISBNs!.ConvertAll(isbn => Isbn.Create(isbn.Value!, (IsbnFormat)(int)isbn.Format!));
errors = domainIsbnsResult.Where(isbnResult => isbnResult.IsError).SelectMany(isbnResult => isbnResult.Errors).ToList();
errors = [.. domainIsbnsResult.Where(isbnResult => isbnResult.IsError).SelectMany(isbnResult => isbnResult.Errors)];
if (errors.Count != 0)
return errors;
List<Isbn> domainIsbns = domainIsbnsResult.Select(isbn => isbn.Value).ToList();
List<Isbn> domainIsbns = [.. domainIsbnsResult.Select(isbn => isbn.Value)];
ErrorOr<ReleaseInfo> releaseInfoResult = ReleaseInfo.Create(
Optional<DateOnly>.FromNullable(request.Metadata.ReleaseInfo!.OriginalReleaseDate),
@@ -41,7 +41,7 @@ public class ChangePasswordCommandHandler : IRequestHandler<ChangePasswordComman
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="ChangePasswordResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="ChangePasswordResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<ChangePasswordResponse>> Handle(ChangePasswordCommand request, CancellationToken cancellationToken)
{
@@ -50,7 +50,7 @@ public class RecoverPasswordCommandHandler : IRequestHandler<RecoverPasswordComm
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RecoverPasswordResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RecoverPasswordResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<RecoverPasswordResponse>> Handle(RecoverPasswordCommand request, CancellationToken cancellationToken)
{
@@ -59,7 +59,7 @@ public class RegisterUserCommandHandler : IRequestHandler<RegisterUserCommand, E
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="RegistrationResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="RegistrationResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<RegistrationResponse>> Handle(RegisterUserCommand request, CancellationToken cancellationToken)
{
@@ -59,7 +59,7 @@ public class LoginUserQueryHandler : IRequestHandler<LoginUserQuery, ErrorOr<Log
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LoginResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LoginResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<LoginResponse>> Handle(LoginUserQuery request, CancellationToken cancellationToken)
{
@@ -48,7 +48,7 @@ public class UpdateUserRoleAndPermissionsCommandHandler : IRequestHandler<Update
/// <param name="request">The request to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly updated <see cref="RoleResponse"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully updated <see cref="RoleResponse"/>, or an error message.
/// </returns>
public async ValueTask<ErrorOr<AuthorizationResponse>> Handle(UpdateUserRoleAndPermissionsCommand request, CancellationToken cancellationToken)
{
@@ -49,7 +49,7 @@ internal sealed class LibraryRepository : ILibraryRepository
/// <summary>
/// Gets a <see cref="LibraryEntity"/> identified by <paramref name="id"/> from the storage medium.
/// </summary>
/// <param name="id">The id of the library to get.</param>
/// <param name="id">The Id of the library to get.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a <see cref="LibraryEntity"/> identified by <paramref name="id"/>, or an error.</returns>
public async Task<ErrorOr<LibraryEntity?>> GetByIdAsync(Guid id, CancellationToken cancellationToken)
@@ -120,9 +120,9 @@ internal sealed class LibraryRepository : ILibraryRepository
}
/// <summary>
/// Deletes a library by its ID.
/// Deletes a library by its Id.
/// </summary>
/// <param name="id">The ID of the library to delete.</param>
/// <param name="id">The Id of the library to delete.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
public async Task<ErrorOr<Deleted>> DeleteByIdAsync(Guid id, CancellationToken cancellationToken)
@@ -32,7 +32,7 @@ public class Genre : ValueObject
/// </summary>
/// <param name="name">The value of the genre.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Genre"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Genre"/>, or an error message.
/// </returns>
public static ErrorOr<Genre> Create(string? name)
{
@@ -49,7 +49,7 @@ public class LanguageInfo : ValueObject
/// <param name="languageName">The full name of the language in English.</param>
/// <param name="nativeName">The optional native name of the language.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LanguageInfo"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LanguageInfo"/>, or an error message.
/// </returns>
public static ErrorOr<LanguageInfo> Create(string? languageCode, string? languageName, Optional<string> nativeName)
{
@@ -81,7 +81,7 @@ public class ReleaseInfo : ValueObject
/// <param name="releaseCountry">The optional country or region of release.</param>
/// <param name="releaseVersion">The optional release version or edition.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="ReleaseInfo"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="ReleaseInfo"/>, or an error message.
/// </returns>
public static ErrorOr<ReleaseInfo> Create(
Optional<DateOnly> originalReleaseDate,
@@ -32,7 +32,7 @@ public class Tag : ValueObject
/// </summary>
/// <param name="name">The value of the tag.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Tag"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Tag"/>, or an error message.
/// </returns>
public static ErrorOr<Tag> Create(string? name)
{
@@ -102,7 +102,7 @@ public class AudioMetadata : BaseMetadata
/// <param name="genres">The genres of the audio.</param>
/// <param name="tags">The tags associated with the audio.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="AudioMetadata"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="AudioMetadata"/>, or an error message.
/// </returns>
public static ErrorOr<AudioMetadata> Create(
string title,
@@ -55,7 +55,7 @@ public sealed class Directory : FileSystemItem
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
/// <param name="status">The status of the file system item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Directory"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Directory"/>, or an error message.
/// </returns>
public static ErrorOr<Directory> Create(
string path,
@@ -87,7 +87,7 @@ public sealed class Directory : FileSystemItem
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
/// <param name="status">The status of the file system item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Directory"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Directory"/>, or an error message.
/// </returns>
public static ErrorOr<Directory> Create(
FileSystemPathId id,
@@ -56,7 +56,7 @@ public sealed class File : FileSystemItem
/// <param name="size">The size of the file in bytes.</param>
/// <param name="status">The status of the file system item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="File"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="File"/>, or an error message.
/// </returns>
public static ErrorOr<File> Create(
string path,
@@ -92,7 +92,7 @@ public sealed class File : FileSystemItem
/// <param name="size">The size of the file in bytes.</param>
/// <param name="status">The status of the file system item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="File"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="File"/>, or an error message.
/// </returns>
public static ErrorOr<File> Create(
FileSystemPathId id,
@@ -37,7 +37,7 @@ public sealed class UnixRootItem : FileSystemItem
/// </summary>
/// <param name="status">The status of the file system root item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="UnixRootItem"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="UnixRootItem"/>, or an error message.
/// </returns>
public static ErrorOr<UnixRootItem> Create(FileSystemItemStatus status = FileSystemItemStatus.Accessible)
{
@@ -38,7 +38,7 @@ public sealed class WindowsRootItem : FileSystemItem
/// <param name="name">The name of the file system root item.</param>
/// <param name="status">The status of the file system root item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WindowsRootItem"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WindowsRootItem"/>, or an error message.
/// </returns>
public static ErrorOr<WindowsRootItem> Create(
string path,
@@ -65,7 +65,7 @@ public sealed class WindowsRootItem : FileSystemItem
/// <param name="name">The name of the file system root item.</param>
/// <param name="status">The status of the file system root item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WindowsRootItem"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WindowsRootItem"/>, or an error message.
/// </returns>
public static ErrorOr<WindowsRootItem> Create(
FileSystemPathId id,
@@ -39,7 +39,7 @@ public sealed class FileSystemPathId : ValueObject
/// </summary>
/// <param name="path">The path of the file system item.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="FileSystemPathId"/> or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="FileSystemPathId"/> or an error message.
/// </returns>
public static ErrorOr<FileSystemPathId> Create(string path)
{
@@ -49,7 +49,7 @@ public class PathSegment : ValueObject
/// <param name="isDirectory">Value indicating if the current path segment is a file system directory or not.</param>
/// <param name="isDrive">Value indicating if the current path segment is a file system drive or not.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="PathSegment"/> or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="PathSegment"/> or an error message.
/// </returns>
public static ErrorOr<PathSegment> Create(string name, bool isDirectory, bool isDrive)
{
@@ -98,7 +98,7 @@ public class StreamInfo : ValueObject
/// <param name="sampleRate">The sample rate of the stream (for audio).</param>
/// <param name="channels">The number of channels (for audio).</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="StreamInfo"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="StreamInfo"/>, or an error message.
/// </returns>
public static ErrorOr<StreamInfo> Create(
string streamId,
@@ -61,7 +61,7 @@ public class LibraryScan : AggregateRoot<ScanId>
/// <param name="userId">The object representing the unique identifier of the user initiating the media library scan.</param>
/// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryScan"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryScan"/>, or an error message.
/// </returns>
public static ErrorOr<LibraryScan> Create(LibraryId libraryId, UserId userId, List<LibraryScan> pastScans)
{
@@ -77,7 +77,7 @@ public class LibraryScan : AggregateRoot<ScanId>
/// <param name="status">The status of the media library scan.</param>
/// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryScan"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryScan"/>, or an error message.
/// </returns>
public static ErrorOr<LibraryScan> Create(ScanId id, LibraryId libraryId, UserId userId, LibraryScanJobStatus status, List<LibraryScan> pastScans)
{
@@ -17,10 +17,10 @@ public interface IMediaLibraryScanningService
/// </summary>
/// <param name="scan">The media library scan to start.</param>
/// <param name="libraryType">The type of the media library to be scanned.</param>
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMedatadaFromWeb, CancellationToken cancellationToken);
Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMetadataFromWeb, CancellationToken cancellationToken);
/// <summary>
/// Cancels <paramref name="scan"/>.
@@ -12,7 +12,6 @@ using Lumina.Domain.Core.BoundedContexts.UserManagementBoundedContext.UserAggreg
using Mediator;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -57,10 +56,10 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService
/// </summary>
/// <param name="scan">The media library scan to start.</param>
/// <param name="libraryType">The type of the media library to be scanned.</param>
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
public async Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMedatadaFromWeb, CancellationToken cancellationToken)
public async Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMetadataFromWeb, CancellationToken cancellationToken)
{
// mark the scan itself as started
ErrorOr<Success> startScanResult = scan.StartScan();
@@ -76,14 +75,14 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService
try
{
// link the user's cancellation token with the scan's token
CancellationTokenSource linkedSource = CancellationTokenSource
using CancellationTokenSource linkedSource = CancellationTokenSource
.CreateLinkedTokenSource(cancellationToken, _mediaLibrariesScanCancellationTracker.GetTokenForScan(MediaLibraryScanCompositeId.Create(scan.Id, scan.UserId)));
// get a media library scanner for the provided media library type
IMediaTypeScanner scanner = _mediaLibraryScannerFactory.CreateLibraryScanner(libraryType);
// get the list of scan jobs for the retrieved scanner. It is impotant to enumerate them here, because deferred execuction would destroy any graph relationships
// and properties we might set before putting the jobs on the in-memory queue.
List<IMediaLibraryScanJob> jobs = scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMedatadaFromWeb).ToList();
List<IMediaLibraryScanJob> jobs = [.. scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMetadataFromWeb)];
// count total jobs in the chain by traversing the job graph
int totalJobs = CountTotalJobs(jobs);
@@ -21,7 +21,7 @@ public interface IMediaTypeScanner
/// Creates the media library scan jobs for the provided media library.
/// </summary>
/// <param name="libraryId">The unique identifier of the media library for which to create the media library scan jobs.</param>
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
/// <returns>A collection of media library scan jobs.</returns>
IEnumerable<IMediaLibraryScanJob> CreateScanJobsForLibrary(LibraryId libraryId, bool downloadMedatadaFromWeb);
IEnumerable<IMediaLibraryScanJob> CreateScanJobsForLibrary(LibraryId libraryId, bool downloadMetadataFromWeb);
}
@@ -54,7 +54,7 @@ public sealed class MediaLibraryScanJobProgress : ValueObject
/// <param name="totalItems">The total number of items of the media library scan job.</param>
/// <param name="currentOperation">The current operation being performed by the media library scan job.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanJobProgress"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanJobProgress"/>, or an error message.
/// </returns>
public static ErrorOr<MediaLibraryScanJobProgress> Create(int completedItems, int totalItems, string currentOperation)
{
@@ -97,7 +97,7 @@ public sealed class MediaLibraryScanProgress : ValueObject
/// <param name="status">The status of the media library scan.</param>
/// <param name="currentJobProgress">The optional current job progress of the media library scan.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanProgress"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanProgress"/>, or an error message.
/// </returns>
public static ErrorOr<MediaLibraryScanProgress> Create(
ScanId scanId,
@@ -33,7 +33,7 @@ public sealed class User : AggregateRoot<UserId>
/// </summary>
/// <param name="username">The username of the user.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="User"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="User"/>, or an error message.
/// </returns>
public static ErrorOr<User> Create(string username)
{
@@ -46,7 +46,7 @@ public sealed class User : AggregateRoot<UserId>
/// <param name="id">The object representing the unique identifier of the user.</param>
/// <param name="username">The username of the user.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="User"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="User"/>, or an error message.
/// </returns>
public static ErrorOr<User> Create(UserId id, string username)
{
@@ -96,7 +96,7 @@ public class VideoMetadata : BaseMetadata
/// <param name="genres">The genres of the video.</param>
/// <param name="tags">The tags associated with the video.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="VideoMetadata"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="VideoMetadata"/>, or an error message.
/// </returns>
public static ErrorOr<VideoMetadata> Create(
string title,
@@ -196,7 +196,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param>
/// <param name="ratings">The list of ratings for the book.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Book"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Book"/>, or an error message.
/// </returns>
public static ErrorOr<Book> Create(
WrittenContentMetadata metadata,
@@ -266,7 +266,7 @@ public sealed class Book : AggregateRoot<BookId>
/// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param>
/// <param name="ratings">The list of ratings for the book.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Book"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Book"/>, or an error message.
/// </returns>
public static ErrorOr<Book> Create(
BookId id,
@@ -56,7 +56,7 @@ public sealed class BookSeries : Entity<BookSeriesId>
/// <param name="isComplete">The current status of the book series.</param>
/// <param name="books">The books of the book series.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookSeries"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookSeries"/>, or an error message.
/// </returns>
public static ErrorOr<BookSeries> Create(
BookSeriesId id,
@@ -80,7 +80,7 @@ public sealed class BookSeries : Entity<BookSeriesId>
/// <param name="isComplete">The current status of the book series.</param>
/// <param name="books">The books of the book series.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookSeries"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookSeries"/>, or an error message.
/// </returns>
public static ErrorOr<BookSeries> Create(
WrittenContentMetadata metadata,
@@ -42,7 +42,7 @@ public class BookRating : Rating
/// <param name="source">The optional source of the rating.</param>
/// <param name="voteCount">The optional number of votes or reviews.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Rating"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Rating"/>, or an error message.
/// </returns>
public static ErrorOr<BookRating> Create(decimal value, decimal maxValue, Optional<BookRatingSource> source, Optional<int> voteCount)
{
@@ -69,7 +69,7 @@ public class WrittenContentMetadata : BaseMetadata
/// <param name="publisher">The publisher of the written content, if applicable.</param>
/// <param name="pageCount">The number of pages in the written content, if applicable.</param>
/// <returns>
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WrittenContentMetadata"/>, or an error message.
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WrittenContentMetadata"/>, or an error message.
/// </returns>
public static ErrorOr<WrittenContentMetadata> Create(
string title,
@@ -27,7 +27,7 @@ public class DomainEventsQueue : IDomainEventsQueue
/// </summary>
/// <param name="domainEvent">When this method returns, contains the domain event removed from the queue, or the default value of <see cref="IDomainEvent"/> if the queue is empty.
/// </param>
/// <returns><see langword="true"/> if a domain event was successfuly dequeued, <see langword="false"/> otherwise.</returns>
/// <returns><see langword="true"/> if a domain event was successfully dequeued, <see langword="false"/> otherwise.</returns>
public bool TryDequeue(out IDomainEvent domainEvent)
{
return _queue.TryDequeue(out domainEvent!);
@@ -13,7 +13,7 @@ using System.Threading.Tasks;
namespace Lumina.Presentation.Api.Common.Middlewares;
/// <summary>
/// Middleware that ensures eventual consistency by handling domain events and publishing them after the request has completed successfuly.
/// Middleware that ensures eventual consistency by handling domain events and publishing them after the request has completed successfully.
/// </summary>
public class EventualConsistencyMiddleware
{
@@ -52,9 +52,9 @@ public class EventualConsistencyMiddleware
{
// commit the transaction: because some domain events trigger jobs that end up being processed in background hosted services, and those are
// singletons that require their own DI scope to be created, any changes made on the DbContext in this HTTP scope would not be seen on the
// DbContext created in the background service scope, because the transaction is not yet commited here; therefor, the transaction needs to be
// commited first, before any domain events are fired
// see docs/technical/achitecture/architecture-knowledge-management/architecture-decision-log/architecture-decission-record-0002.md for details:
// DbContext created in the background service scope, because the transaction is not yet committed here; therefor, the transaction needs to be
// committed first, before any domain events are fired
// see docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0002.md for details:
await transaction.CommitAsync().ConfigureAwait(false);
// check if domain events exist in the channel queue and publish them
@@ -40,7 +40,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
ResponseParam<RolePermissionsResponse>(r => r.Permissions, "The list of permissions of the role entity.");
Response(200, "The authorization role was successfuly created.", example:
Response(200, "The authorization role was successfully created.", example:
new RolePermissionsResponse(
Role: new RoleDto(Id: Guid.NewGuid(), "Editor"),
Permissions: [new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanDeleteUsers), new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanViewUsers)]
@@ -30,7 +30,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
RequestParam(r => r.RoleId, "The unique identifier of the role. Required.");
Response(204, "The authorization role was successfuly deleted.");
Response(204, "The authorization role was successfully deleted.");
Response(401, "Authentication required.", "application/problem+json",
example: new[]
@@ -42,7 +42,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
ResponseParam<RolePermissionsResponse>(r => r.Permissions, "The list of permissions of the role entity.");
Response(200, "The authorization role was successfuly updated.", example:
Response(200, "The authorization role was successfully updated.", example:
new RolePermissionsResponse(
Role: new RoleDto(Id: Guid.NewGuid(), "Editor"),
Permissions: [new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanDeleteUsers), new PermissionDto(Guid.NewGuid(), AuthorizationPermission.CanViewUsers)]
@@ -28,7 +28,7 @@ public class SplitPathEndpointSummary : Summary<SplitPathEndpoint, SplitPathRequ
RequestParam(r => r.Path, "The file system path for which to get the path segments. Required.");
Response(200, "successfuly split the path into segments.",
Response(200, "successfully split the path into segments.",
example: new PathSegmentResponse[2] {
new(Path: "media"),
new(Path: "movies")
@@ -30,7 +30,7 @@ public class DeleteLibraryEndpointSummary : Summary<DeleteLibraryEndpoint, Delet
RequestParam(r => r.Id, "The unique identifier of the media library to be deleted. Required.");
Response(200, "The media library was successfuly deleted.");
Response(200, "The media library was successfully deleted.");
Response(401, "Authentication required.", "application/problem+json",
example: new[]
@@ -43,7 +43,7 @@ public class UpdateUserRoleAndPermissionsEndpointSummary : Summary<UpdateUserRol
ResponseParam<AuthorizationResponse>(r => r.Permissions, "The list of permissions of the user.");
Response(200, "The authorization role and permissions of the user were successfuly updated.", example:
Response(200, "The authorization role and permissions of the user were successfully updated.", example:
new AuthorizationResponse(
UserId: Guid.NewGuid(),
Role: "Editor",
+3 -3
View File
@@ -188,9 +188,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "architecture-knowledge-mana
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "architecture-decision-log", "architecture-decision-log", "{788FADE4-342D-4919-8E5C-10CA8EDBE954}"
ProjectSection(SolutionItems) = preProject
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0001.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0001.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0002.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0002.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0003.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decission-record-0003.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0001.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0001.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0002.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0002.md
..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0003.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0003.md
EndProjectSection
EndProject
Global
@@ -180,7 +180,7 @@ public class GetDirectoriesEndpointTests : IClassFixture<AuthenticatedLuminaApiF
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -84,7 +84,7 @@ public class GetTypeEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
@@ -220,7 +220,7 @@ public class GetFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -220,7 +220,7 @@ public class GetTreeFilesEndpointTests : IClassFixture<AuthenticatedLuminaApiFac
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -100,7 +100,7 @@ public class CombinePathEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
string originalPath = "/home/user";
@@ -171,7 +171,7 @@ public class GetPathParentEndpointTests : IClassFixture<AuthenticatedLuminaApiFa
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
string testPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "testDirectory");
@@ -128,7 +128,7 @@ public class GetPathRootEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
string testPath = System.IO.Path.GetTempPath();
@@ -83,7 +83,7 @@ public class GetPathSeparatorEndpointTests : IClassFixture<AuthenticatedLuminaAp
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
@@ -60,7 +60,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldSetupApplicationsuccessfuly()
public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldSetupApplicationSuccessfully()
{
// Arrange
RegistrationRequest request = new(
@@ -94,7 +94,7 @@ public class SetupApplicationEndpointTests : IClassFixture<AuthenticatedLuminaAp
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequestWithout2FA_ShouldSetupApplicationsuccessfuly()
public async Task ExecuteAsync_WhenCalledWithValidRequestWithout2FA_ShouldSetupApplicationSuccessfully()
{
// Arrange
RegistrationRequest request = new(
@@ -54,7 +54,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldChangePasswordsuccessfuly()
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldChangePasswordSuccessfully()
{
// Arrange
ChangePasswordRequest request = new(
@@ -68,7 +68,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithValidCredentials_ShouldLoginsuccessfuly()
public async Task ExecuteAsync_WhenCalledWithValidCredentials_ShouldLoginSuccessfully()
{
// Arrange
UserEntity user = await CreateTestUser();
@@ -95,7 +95,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithValidCredentialsAndTotp_ShouldLoginsuccessfuly()
public async Task ExecuteAsync_WhenCalledWithValidCredentialsAndTotp_ShouldLoginSuccessfully()
{
// Arrange
UserEntity user = await CreateTestUserWithTotp();
@@ -127,7 +127,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithTempPassword_ShouldLoginsuccessfuly()
public async Task ExecuteAsync_WhenCalledWithTempPassword_ShouldLoginSuccessfully()
{
// Arrange
UserEntity user = await CreateTestUserWithTempPassword();
@@ -57,7 +57,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldRegisterUsersuccessfuly()
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldRegisterUserSuccessfully()
{
// Arrange
RegistrationRequest request = new(
@@ -65,7 +65,7 @@ public class GetBooksEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
}
[Fact]
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompletesuccessfuly()
public async Task ExecuteAsync_WhenCalledWithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
using CancellationTokenSource cts = new(TimeSpan.FromSeconds(5));
@@ -58,7 +58,7 @@ public class LoginEndpointTests : IClassFixture<LuminaApiFactory>, IDisposable
}
[Fact]
public async Task Login_WithValidCredentials_ShouldAuthenticatesuccessfuly()
public async Task Login_WithValidCredentials_ShouldAuthenticateSuccessfully()
{
// Arrange
UserEntity user = await CreateTestUser();
@@ -83,7 +83,7 @@ public class GetPathSeparatorQueryHandlerTests
}
[Fact]
public async Task Handle_WithCancellationToken_ShouldCompletesuccessfuly()
public async Task Handle_WithCancellationToken_ShouldCompleteSuccessfully()
{
// Arrange
GetPathSeparatorQuery query = new();
@@ -847,7 +847,7 @@ public class DirectoryProviderServiceTests
}
[Fact]
public void RenameDirectory_WhenParentDirectoryIsWritable_ShouldRenamesuccessfuly()
public void RenameDirectory_WhenParentDirectoryIsWritable_ShouldRenameSuccessfully()
{
// Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
@@ -971,7 +971,7 @@ public class DirectoryProviderServiceTests
}
[Fact]
public void DeleteDirectory_WhenDirectoryExistsAndHasDeletePermission_ShouldDeletesuccessfuly()
public void DeleteDirectory_WhenDirectoryExistsAndHasDeletePermission_ShouldDeleteSuccessfully()
{
// Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
@@ -737,7 +737,7 @@ public class FileProviderServiceTests
}
[Fact]
public void RenameFile_WhenParentDirectoryIsWritable_ShouldRenamesuccessfuly()
public void RenameFile_WhenParentDirectoryIsWritable_ShouldRenameSuccessfully()
{
// Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(
@@ -894,7 +894,7 @@ public class FileProviderServiceTests
}
[Fact]
public void DeleteFile_WhenFileExistsAndHasDeletePermission_ShouldDeletesuccessfuly()
public void DeleteFile_WhenFileExistsAndHasDeletePermission_ShouldDeleteSuccessfully()
{
// Arrange
FileSystemPathId path = _fileSystemPathIdFixture.CreateFileSystemPathId(