public UnitTest1() { var builder = new DbContextOptionsBuilder <FilmRatingsDBContext>().UseSqlServer("Server = localhost\\SQLEXPRESS; Database = FilmRatingsDB; Trusted_Connection = True; "); _context = new FilmRatingsDBContext(builder.Options); _controller = new ComptesController(_context); }
public void TestInit() { var builder = new DbContextOptionsBuilder <FilmsDBContext>().UseNpgsql("Server=localhost;port=5432;Database=FilmsDBTP3;uid=postgres;password=postgres;"); _context = new FilmsDBContext(builder.Options); _dataRepository = new CompteManager(_context); _controller = new ComptesController(_dataRepository); }