Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# Unit Test IDbContextFactory

mockDbFactory.Setup(f => f.CreateDbContext())
    .Returns(() => new SomeDbContext(new DbContextOptionsBuilder<SomeDbContext>()
        .UseInMemoryDatabase("InMemoryTest")
        .Options));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Unit #Test #IDbContextFactory
ADD COMMENT
Topic
Name
7+5 =