mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 19:21:10 +00:00
Updates the provider configuration and ownership tests
Covers the provider and reader choices saved with a library, the reconciliation and stale configuration deletion in the provider store, the library type lookups, the ownership and permission checks for update and delete, and the validator behavior for enum names.
This commit is contained in:
1 parent
48ad8692af
commit
64e5163229
127 files changed
+5541
-5296
No files matched your search
-46
@@ -1,46 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Application.Core.Plugins.Commands.ReorderLibraryArtworkProviders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Plugins.Commands.ReorderLibraryArtworkProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ReorderLibraryArtworkProvidersCommand"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderLibraryArtworkProvidersCommandFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid command to reorder the artwork providers of a media library.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the media library whose artwork providers are reordered.</param>
|
||||
/// <param name="pluginIds">Optional. The plugin Ids in the new order.</param>
|
||||
/// <returns>The created command.</returns>
|
||||
public ReorderLibraryArtworkProvidersCommand Create(
|
||||
Guid? libraryId = null,
|
||||
IReadOnlyList<Guid>? pluginIds = null)
|
||||
{
|
||||
return new Faker<ReorderLibraryArtworkProvidersCommand>()
|
||||
.CustomInstantiator(f => new ReorderLibraryArtworkProvidersCommand(
|
||||
default,
|
||||
default!))
|
||||
.RuleFor(x => x.LibraryId, libraryId ?? Guid.NewGuid())
|
||||
.RuleFor(x => x.PluginIds, f => pluginIds ?? [Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()])
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="ReorderLibraryArtworkProvidersCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<ReorderLibraryArtworkProvidersCommand> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Application.Core.Plugins.Commands.ReorderLibraryMetadataProviders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Plugins.Commands.ReorderLibraryMetadataProviders;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ReorderLibraryMetadataProvidersCommand"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderLibraryMetadataProvidersCommandFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid command to reorder the metadata providers of a media library.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the media library whose metadata providers are reordered.</param>
|
||||
/// <param name="pluginIds">Optional. The plugin Ids in the new order.</param>
|
||||
/// <returns>The created command.</returns>
|
||||
public ReorderLibraryMetadataProvidersCommand Create(Guid? libraryId = null, IReadOnlyList<Guid>? pluginIds = null)
|
||||
{
|
||||
return new Faker<ReorderLibraryMetadataProvidersCommand>()
|
||||
.CustomInstantiator(f => new ReorderLibraryMetadataProvidersCommand(
|
||||
default,
|
||||
default!))
|
||||
.RuleFor(x => x.LibraryId, libraryId ?? Guid.NewGuid())
|
||||
.RuleFor(x => x.PluginIds, f => pluginIds ?? [Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()])
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="ReorderLibraryMetadataProvidersCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<ReorderLibraryMetadataProvidersCommand> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Application.Core.Plugins.Commands.SetLibraryArtworkProviderEnabled;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Plugins.Commands.SetLibraryArtworkProviderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SetLibraryArtworkProviderEnabledCommand"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetLibraryArtworkProviderEnabledCommandFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid command to enable or disable an artwork provider for a media library.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the media library whose artwork provider is enabled or disabled.</param>
|
||||
/// <param name="pluginId">Optional. The Id of the plugin providing the artwork.</param>
|
||||
/// <param name="isEnabled">Whether the artwork provider should be enabled for the media library.</param>
|
||||
/// <returns>The created command.</returns>
|
||||
public SetLibraryArtworkProviderEnabledCommand Create(
|
||||
Guid? libraryId = null,
|
||||
Guid? pluginId = null,
|
||||
bool isEnabled = true)
|
||||
{
|
||||
return new Faker<SetLibraryArtworkProviderEnabledCommand>()
|
||||
.CustomInstantiator(f => new SetLibraryArtworkProviderEnabledCommand(
|
||||
default,
|
||||
default,
|
||||
true))
|
||||
.RuleFor(x => x.LibraryId, libraryId ?? Guid.NewGuid())
|
||||
.RuleFor(x => x.PluginId, pluginId ?? Guid.NewGuid())
|
||||
.RuleFor(x => x.IsEnabled, isEnabled)
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="SetLibraryArtworkProviderEnabledCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<SetLibraryArtworkProviderEnabledCommand> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Plugins.Commands.SetLibraryBookReaderEnabled;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Plugins.Commands.SetLibraryBookReaderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SetLibraryBookReaderEnabledCommand"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetLibraryBookReaderEnabledCommandFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid command to enable or disable a book reader for a media library.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the media library whose book reader is enabled or disabled.</param>
|
||||
/// <param name="pluginId">Optional. The unique identifier of the plugin providing the book reader.</param>
|
||||
/// <param name="isEnabled">Optional. Whether the book reader should be enabled for the media library.</param>
|
||||
/// <returns>The created <see cref="SetLibraryBookReaderEnabledCommand"/>.</returns>
|
||||
public SetLibraryBookReaderEnabledCommand Create(
|
||||
Guid? libraryId = null,
|
||||
Guid? pluginId = null,
|
||||
bool? isEnabled = null)
|
||||
{
|
||||
return new SetLibraryBookReaderEnabledCommand(libraryId ?? Guid.NewGuid(), pluginId ?? Guid.NewGuid(), isEnabled ?? true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="SetLibraryBookReaderEnabledCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<SetLibraryBookReaderEnabledCommand> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Application.Core.Plugins.Commands.SetLibraryMetadataProviderEnabled;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Plugins.Commands.SetLibraryMetadataProviderEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SetLibraryMetadataProviderEnabledCommand"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetLibraryMetadataProviderEnabledCommandFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid command to enable or disable a metadata provider for a media library.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">Optional. The Id of the media library whose metadata provider is enabled or disabled.</param>
|
||||
/// <param name="pluginId">Optional. The Id of the plugin providing the metadata.</param>
|
||||
/// <param name="isEnabled">Whether the metadata provider should be enabled for the media library.</param>
|
||||
/// <returns>The created command.</returns>
|
||||
public SetLibraryMetadataProviderEnabledCommand Create(Guid? libraryId = null, Guid? pluginId = null, bool isEnabled = true)
|
||||
{
|
||||
return new Faker<SetLibraryMetadataProviderEnabledCommand>()
|
||||
.CustomInstantiator(f => new SetLibraryMetadataProviderEnabledCommand(
|
||||
default,
|
||||
default,
|
||||
true))
|
||||
.RuleFor(x => x.LibraryId, libraryId ?? Guid.NewGuid())
|
||||
.RuleFor(x => x.PluginId, pluginId ?? Guid.NewGuid())
|
||||
.RuleFor(x => x.IsEnabled, isEnabled)
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="SetLibraryMetadataProviderEnabledCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<SetLibraryMetadataProviderEnabledCommand> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user