示例#1
0
        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();
        }
示例#2
0
 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);
 }