using System.IO;
using System.Threading.Tasks;
using FluentAssertions;
using NexusReader.Infrastructure.Services;
using Xunit;

namespace NexusReader.Application.Tests.Services;

public class EpubMetadataExtractorTests
{
    [Fact]
    public async Task ExtractMetadataAsync_WithInvalidStream_ReturnsFailure()
    {
        // Arrange
        var extractor = new EpubMetadataExtractor();
        using var stream = new MemoryStream(new byte[] { 0, 1, 2, 3 });

        // Act
        var result = await extractor.ExtractMetadataAsync(stream);

        // Assert
        result.IsSuccess.Should().BeFalse();
        result.Errors.Should().NotBeEmpty();
    }
}
