Skip to content

Commit

Permalink
database ensure created addet to SqlDatabaseTestBase
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamyab7 committed Feb 4, 2024
1 parent e7ff7e5 commit 11c0606
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Data.Common;
using System.Threading.Tasks;
using LinkDotNet.Blog.Domain;
Expand All @@ -22,6 +22,8 @@ protected SqlDatabaseTestBase()
DbContextFactory = Substitute.For<IDbContextFactory<BlogDbContext>>();
DbContextFactory.CreateDbContextAsync()
.Returns(_ => new BlogDbContext(options));

DbContext.Database.EnsureCreated();
Repository = new Repository<TEntity>(DbContextFactory, Substitute.For<ILogger<Repository<TEntity>>>());
}

Expand Down

0 comments on commit 11c0606

Please sign in to comment.