public SmsDbContextTeacherFixture() { var builder = new DbContextOptionsBuilder <SmsDbContext>(); var path = $"{Environment.CurrentDirectory.Split("SMS.Tests.DAL")[0]}SqLiteDb\\smsTestTeacher.db"; builder.UseSqlite($"Filename={path}"); SmsDbContext = new SmsDbContext(builder.Options); SmsDbContext.Database.OpenConnectionAsync(); SmsDbContext.Database.EnsureCreatedAsync(); }
public SmsDbContextStudentFixture() { var builder = new DbContextOptionsBuilder <SmsDbContext>(); //builder.UseInMemoryDatabase("databaseName=SMSTest"); // inmemory seçildiği için ilişkiler oluşmuyor yani foreign key testleri yapılamaz. // veri eğer kaydedilirse diske Filename:sms gibi bir connections string yazılarak yapaılabilir. //builder.UseSqlite("DataSource=:memory:"); var path = $"{Environment.CurrentDirectory.Split("SMS.Tests.DAL")[0]}SqLiteDb\\smsTestStudent.db"; builder.UseSqlite($"Filename={path}"); SmsDbContext = new SmsDbContext(builder.Options); SmsDbContext.Database.OpenConnection(); SmsDbContext.Database.EnsureCreated(); }
public StudentAsyncRepositoryTests(SmsDbContextStudentFixture SmsDbContextFixture) { SmsDbContext = SmsDbContextFixture.SmsDbContext; asyncStudentRepository = new BaseAsyncRepository <Student>(SmsDbContext); }
public SmsController(SmsDbContext context) { _context = context; }
public StudentsController(SmsDbContext db, IMapper mapper, StudentsService studentsService) { this.db = db; this.mapper = mapper; this.studentsService = studentsService; }
public TeacherAsyncRepositoryTests(SmsDbContextTeacherFixture SmsDbContextFixture) { _smsDbContext = SmsDbContextFixture.SmsDbContext; _asyncTeacherRepository = new BaseAsyncRepository <Teacher>(_smsDbContext); }
public SmsDbContextStudentCollectionFixture(SmsDbContextStudentFixture smsDbContextFixture) { SmsDbContext = smsDbContextFixture.SmsDbContext; }
public Repository(SmsDbContext context) { _context = context; _entities = context.Set <TEntity>(); }
public SmsDbContextTeacherCollectionFixture(SmsDbContextTeacherFixture smsDbContextFixture) { SmsDbContext = smsDbContextFixture.SmsDbContext; }
public SmsRepository(SmsDbContext db) { this.db = db; }
public StudentsService(SmsDbContext db) { this.db = db; }