private void setUp() { var builder = new DbContextOptionsBuilder <CegepContext>(); builder.UseInMemoryDatabase(databaseName: "testCours_db"); // Database en mémoire var context = new CegepContext(builder.Options); repoInscriptions = new EFInscCoursRepository(context); repoEtudiants = new EFEtudiantRepository(context); repoCours = new EFCoursRepository(context); /*Etudiant etud = new Etudiant * { * Nom = "Simard", * Prenom = "Serge", * DateNaissance = Convert.ToDateTime("1977-10-10"), * NoProgramme = 420 * }; * * Etudiant etud2 = new Etudiant * { * Nom = "Tremblay", * Prenom = "Sylvie", * DateNaissance = Convert.ToDateTime("1982-10-10"), * NoProgramme = 420 * };*/ }
private void SetUp() { // Initialiser les objets nécessaires aux tests var builder = new DbContextOptionsBuilder <CegepContext>(); builder.UseInMemoryDatabase(databaseName: "testInscription_db"); // Database en mémoire var context = new CegepContext(builder.Options); repoInscriptions = new EFInscCoursRepository(context); repoEtudiants = new EFEtudiantRepository(context); }
private void SetUp() { var builder = new DbContextOptionsBuilder <CegepContext>(); builder.UseInMemoryDatabase(databaseName: "testEtudiant_db"); var contexte = new CegepContext(builder.Options); repoEtu = new EFEtudiantRepository(contexte); repoInsc = new EFInscCoursRepository(contexte); repoCours = new EFCoursRepository(contexte); }