public EinTechContextFixture() { _connection = new SqliteConnection("Filename=:memory:"); _connection.Open(); DbContextOptions <EinTechContext> contextOptions = new DbContextOptionsBuilder <EinTechContext>().UseSqlite(_connection).Options; _connection = RelationalOptionsExtension.Extract(contextOptions).Connection; Context = new EinTechContext(contextOptions); Context.Database.EnsureDeleted(); Context.Database.EnsureCreated(); Seed(); }
public PersonRepository(EinTechContext einTechContext, ISystemInfo systemInfo) { _einTechContext = einTechContext; _systemInfo = systemInfo; }
public PersonRepositoryTests(EinTechContextFixture contextFixture) { _context = contextFixture.Context; _mockSystemInfo = new Mock <ISystemInfo>(MockBehavior.Strict); _personRespository = new PersonRepository(contextFixture.Context, _mockSystemInfo.Object); }