Refactor DTOs and tests; add framework-specific handling
Refactored the codebase to use shared DTOs from `DocumentService.Application.Common.DTOs`, removing inline DTO definitions in client interfaces and tests. Introduced conditional compilation to handle framework-specific differences in DTOs and handlers. Updated test cases to align with the new DTO structures, including `SwissQrCodeExtractionResult`, `PdfValidationResult`, and `ZugferdExtractionResult`. Adjusted test data to match updated DTO properties. Cleaned up solution and project files, ensuring proper references and organization. Removed unused files and fixed project references in `DocumentService.Tests.csproj`. Improved maintainability and consistency across the codebase.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using DocumentService.Application.Common.DTOs;
|
||||
using DocumentService.Client.Clients;
|
||||
using DocumentService.Client.Interfaces;
|
||||
using DocumentService.Client.Models.Requests;
|
||||
@@ -63,7 +64,7 @@ public class PdfAttachmentClientTests
|
||||
{
|
||||
HasAttachments = true,
|
||||
AttachmentCount = 1,
|
||||
Attachments = new List<AttachmentMetadata>
|
||||
Attachments = new List<AttachmentDto>
|
||||
{
|
||||
new() { FileName = "factur-x.xml", MimeType = "application/xml", Size = 512 }
|
||||
}
|
||||
@@ -85,7 +86,7 @@ public class PdfAttachmentClientTests
|
||||
public async Task CheckAttachmentsAsync_Stream_PdfWithNoAttachments_ReturnsFalse()
|
||||
{
|
||||
// Arrange
|
||||
var expected = new AttachmentCheckResult { HasAttachments = false, AttachmentCount = 0 };
|
||||
var expected = new AttachmentCheckResult { HasAttachments = false, AttachmentCount = 0, Attachments = [] };
|
||||
var (client, _) = BuildJson(expected);
|
||||
|
||||
// Act
|
||||
|
||||
Reference in New Issue
Block a user