Skip to content

Commit

Permalink
Workaround for #610 in memory persistence across tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagonmas committed Jan 1, 2022
1 parent 2b1eee7 commit 323feaa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public class InvoiceRepositoryTests : IClassFixture<ServicesFixture>
/// <param name="servicesFixture">Service list.</param>
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<InvoiceRepository>();
}

Expand Down

0 comments on commit 323feaa

Please sign in to comment.