Refactor: Web Consolidation and Identity Stabilization #40
@@ -0,0 +1,28 @@
|
||||
using NexusReader.Infrastructure.Services;
|
||||
using Xunit;
|
||||
|
||||
namespace NexusReader.Application.Tests.Services;
|
||||
|
||||
public class EpubMetadataExtractorTests
|
||||
{
|
||||
private readonly EpubMetadataExtractor _sut;
|
||||
|
||||
public EpubMetadataExtractorTests()
|
||||
{
|
||||
_sut = new EpubMetadataExtractor();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExtractMetadataAsync_WithInvalidStream_ReturnsFailure()
|
||||
{
|
||||
// Arrange
|
||||
using var invalidStream = new MemoryStream(new byte[] { 0, 1, 2, 3 });
|
||||
|
||||
// Act
|
||||
var result = await _sut.ExtractMetadataAsync(invalidStream);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailed);
|
||||
Assert.Contains("Failed to extract EPUB metadata", result.Errors[0].Message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user