mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 11:11: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
+2
-4
@@ -77,8 +77,6 @@ public class PluginDetectionSyncJobTests
|
||||
.Returns(Result.Deleted);
|
||||
_mockProviderConfigurationStore.EnsureProviderConfigurationsAsync(Arg.Any<Guid>(), Arg.Any<LibraryType>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Result.Success);
|
||||
_mockProviderConfigurationStore.EnsureBookReaderConfigurationsAsync(Arg.Any<Guid>(), Arg.Any<LibraryType>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Result.Success);
|
||||
_mockServiceProvider.GetService(typeof(IUnitOfWork)).Returns(_mockUnitOfWork);
|
||||
_mockServiceProvider.GetService(typeof(IMediaLibraryProviderConfigurationStore)).Returns(_mockProviderConfigurationStore);
|
||||
|
||||
@@ -229,8 +227,8 @@ public class PluginDetectionSyncJobTests
|
||||
await StartAndWaitForExecutionAsync(sut);
|
||||
|
||||
// Assert
|
||||
// A single ensure covers the metadata, artwork and book reader configurations, since a second one before the save would stage duplicates.
|
||||
await _mockProviderConfigurationStore.Received(1).EnsureProviderConfigurationsAsync(bookLibrary.Id, LibraryType.Book, Arg.Any<CancellationToken>());
|
||||
await _mockProviderConfigurationStore.Received(1).EnsureBookReaderConfigurationsAsync(bookLibrary.Id, LibraryType.Book, Arg.Any<CancellationToken>());
|
||||
await _mockUnitOfWork.Received(1).SaveChangesAsync(Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
@@ -239,7 +237,7 @@ public class PluginDetectionSyncJobTests
|
||||
{
|
||||
// Arrange
|
||||
IPlugin previouslyLoadedPlugin = CreatePlugin(Guid.NewGuid(), "My Plugin", new Version(1, 0, 0));
|
||||
_mockPluginManager.GetPlugins().Returns([]); // the plugin assembly now fails to load
|
||||
_mockPluginManager.GetPlugins().Returns([]); // The plugin assembly now fails to load.
|
||||
_mockPluginRepository.UpsertAsync(Arg.Any<PluginEntity>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Result.From(Result.Updated));
|
||||
PluginLoadErrorDto loadError = _pluginLoadErrorDtoFixture.Create(
|
||||
|
||||
Reference in new issue
Block a user