mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Adds the media library artwork aggregation services, enrichers, and their provider contracts
This commit is contained in:
1 parent
00376c8313
commit
9e118864c3
33 files changed
+4621
-1118
No files matched your search
+20
-12
@@ -64,7 +64,7 @@ public class IMetadataProviderGenericTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetSearchResultsAsync_WhenLookupIsOfAnotherRuntimeType_ShouldThrowInvalidCastException()
|
||||
public async Task GetSearchResultsAsync_WhenLookupIsOfAnotherRuntimeType_ShouldReturnEmptyAndNotForward()
|
||||
{
|
||||
// Arrange
|
||||
MetadataLookupDto otherLookup = _otherMetadataLookupDtoFixture.Create();
|
||||
@@ -72,18 +72,15 @@ public class IMetadataProviderGenericTests
|
||||
IMetadataProvider baseProvider = provider;
|
||||
|
||||
// Act
|
||||
async Task Act()
|
||||
{
|
||||
await baseProvider.GetSearchResultsAsync(otherLookup, CancellationToken.None);
|
||||
}
|
||||
IReadOnlyList<MetadataDto> result = await baseProvider.GetSearchResultsAsync(otherLookup, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
await Assert.ThrowsAsync<InvalidCastException>(Act);
|
||||
Assert.Empty(result);
|
||||
Assert.Null(provider.ReceivedLookup);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetMetadataAsync_WhenLookupIsOfAnotherRuntimeType_ShouldThrowInvalidCastException()
|
||||
public async Task GetMetadataAsync_WhenLookupIsOfAnotherRuntimeType_ShouldReturnNullAndNotForward()
|
||||
{
|
||||
// Arrange
|
||||
MetadataLookupDto otherLookup = _otherMetadataLookupDtoFixture.Create();
|
||||
@@ -91,16 +88,27 @@ public class IMetadataProviderGenericTests
|
||||
IMetadataProvider baseProvider = provider;
|
||||
|
||||
// Act
|
||||
async Task Act()
|
||||
{
|
||||
await baseProvider.GetMetadataAsync(otherLookup, CancellationToken.None);
|
||||
}
|
||||
MetadataDto? result = await baseProvider.GetMetadataAsync(otherLookup, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
await Assert.ThrowsAsync<InvalidCastException>(Act);
|
||||
Assert.Null(result);
|
||||
Assert.Null(provider.ReceivedLookup);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LookupType_WhenReadThroughBaseInterface_ShouldReturnTypedLookupType()
|
||||
{
|
||||
// Arrange
|
||||
TestBookMetadataProvider provider = new(_bookMetadataDtoFixture.Create(title: "Exact Result", includeReleaseInfo: false, includeGenres: false, includeTags: false, includeLanguage: false, includeFormat: false, includeVolumeNumber: false));
|
||||
IMetadataProvider baseProvider = provider;
|
||||
|
||||
// Act
|
||||
Type lookupType = baseProvider.LookupType;
|
||||
|
||||
// Assert
|
||||
Assert.Equal(typeof(BookMetadataLookupDto), lookupType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test double for the typed metadata provider interface that records the forwarded arguments.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user