using System; using System.Threading.Tasks; using ComplianceNFs.Infrastructure.Repositories; using ComplianceNFs.Core.Entities; using Xunit; using Moq; using Npgsql; using Microsoft.Extensions.Logging; using Microsoft.EntityFrameworkCore; namespace ComplianceNFs.Infrastructure.Tests { public class AttachmentRepositoryTests { [Fact] public async Task SaveRawAsync_DoesNotThrow_WithValidInvoice() { // Arrange var options = new DbContextOptionsBuilder() .Options; using var dbContext = new ComplianceNFsDbContext(options); var mockLogger = new Mock>(); var repo = new AttachmentRepository(dbContext, mockLogger.Object); var invoice = new EnergyInvoice { MailId = "mailid", ConversationId = "convid", SupplierEmail = "test@supplier.com", ReceivedDate = DateTime.Now, InvoiceId = 1, Filename = "file.xml", Status = InvoiceStatus.Validated }; // Act & Assert await repo.SaveRawAsync(invoice); // Should not throw } } }