using System; using System.Threading.Tasks; using ComplianceNFs.Infrastructure.Repositories; using ComplianceNFs.Core.Entities; using Xunit; using Moq; using Npgsql; namespace ComplianceNFs.Infrastructure.Tests { public class AttachmentRepositoryTests { [Fact] public async Task SaveRawAsync_DoesNotThrow_WithValidInvoice() { // Arrange var repo = new AttachmentRepository("Host=localhost;Port=5432;Database=test;Username=test;Password=test"); var invoice = new EnergyInvoice { MailId = "mailid", ConversationId = "convid", SupplierEmail = "test@supplier.com", ReceivedDate = DateTime.Now, InvoiceId = 1, Filename = "file.xml", Status = InvoiceStatus.Validated }; // This is a placeholder: in a real test, use a test DB or mock NpgsqlConnection/Command // For demonstration, we'll just check that the method can be called without throwing await Assert.ThrowsAnyAsync(async () => await repo.SaveRawAsync(invoice)); } } }