From 323feaa515adb52a1bca246997cfbca4854f8dbc Mon Sep 17 00:00:00 2001 From: Tiago Andrade e Silva Date: Sat, 1 Jan 2022 16:46:28 +0000 Subject: [PATCH] Workaround for #610 in memory persistence across tests. --- .../InvoiceRepositoryTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BancoAlimentar.AlimentaEstaIdeia.Repository.Tests/InvoiceRepositoryTests.cs b/BancoAlimentar.AlimentaEstaIdeia.Repository.Tests/InvoiceRepositoryTests.cs index e1d85f6b..fa1c0456 100644 --- a/BancoAlimentar.AlimentaEstaIdeia.Repository.Tests/InvoiceRepositoryTests.cs +++ b/BancoAlimentar.AlimentaEstaIdeia.Repository.Tests/InvoiceRepositoryTests.cs @@ -28,7 +28,9 @@ public class InvoiceRepositoryTests : IClassFixture /// Service list. public InvoiceRepositoryTests(ServicesFixture servicesFixture) { - this.fixture = servicesFixture; + // Not elegant but solves the issue of persistnence of memory database across tests. + ServicesFixture newServicesFixture = new ServicesFixture(); + this.fixture = newServicesFixture; this.invoiceRepository = this.fixture.ServiceProvider.GetRequiredService(); }