mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 05:11:10 +00:00
Renames project paths from Lumina to Nemera
This commit is contained in:
1 parent
ce6fddb4c9
commit
0f659a4877
6450 files changed
No files matched your search
@@ -0,0 +1,71 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary.Reading;
|
||||
using Lumina.Plugins.Pdf.Core;
|
||||
using Lumina.Plugins.Pdf.Fixtures.Core.Pdf;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Plugins.Pdf.IntegrationTests.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains integration tests for the <see cref="PdfReader"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PdfReaderTests : IDisposable
|
||||
{
|
||||
private readonly string _temporaryDirectory = Path.Combine(Path.GetTempPath(), $"lumina-pdf-reader-{Guid.NewGuid():N}");
|
||||
private readonly string _pdfPath;
|
||||
private readonly PdfReader _sut = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PdfReaderTests"/> class.
|
||||
/// </summary>
|
||||
public PdfReaderTests()
|
||||
{
|
||||
Directory.CreateDirectory(_temporaryDirectory);
|
||||
_pdfPath = Path.Combine(_temporaryDirectory, "minimal.pdf");
|
||||
TestPdfFileFactory.CreateMinimalPdf(_pdfPath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task OpenAsync_WhenCalled_ShouldReturnTheParsedDocument()
|
||||
{
|
||||
// Arrange
|
||||
string workingDirectory = Path.Combine(_temporaryDirectory, "work");
|
||||
|
||||
// Act
|
||||
ReadingDocumentDto result = await _sut.OpenAsync(_pdfPath, workingDirectory, shouldRenderPdfAsImages: false, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.Equal("minimal", result.Title);
|
||||
Assert.Single(result.Spine);
|
||||
}
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
[Fact]
|
||||
public async Task GetResourceAsync_WhenCalledForAPage_ShouldRenderThePageImage()
|
||||
{
|
||||
// Arrange
|
||||
string workingDirectory = Path.Combine(_temporaryDirectory, "work");
|
||||
|
||||
// Act
|
||||
byte[] result = await _sut.GetResourceAsync(_pdfPath, workingDirectory, "page:1", CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(result);
|
||||
Assert.NotEmpty(result);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Dispose()
|
||||
{
|
||||
if (Directory.Exists(_temporaryDirectory))
|
||||
Directory.Delete(_temporaryDirectory, recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user