public void AjouterInscription() { // Arrange SetUp(); Etudiant etud = new Etudiant { Nom = "Simard", Prenom = "Serge", DateNaissance = Convert.ToDateTime("1997-10-10"), NoProgramme = 420 }; repoEtudiants.AjouterEtudiant(etud); string session = "H21"; // Act repoInscriptions.AjouterInscription(etud.EtudiantID, "W49", session); // Assert var result = repoInscriptions.ObtenirInscriptions(); Assert.Single(result); Assert.Same(etud, result.First().Etudiant); Assert.Same("W49", result.First().CodeCours); Assert.Equal(session, result.First().CodeSession); }
public void ValiderNombreCoursInscrits() { // Arrange SetUp(); Etudiant etud = new Etudiant { Nom = "Simard", Prenom = "Serge", DateNaissance = Convert.ToDateTime("1977-10-10"), NoProgramme = 420 }; repoEtudiants.AjouterEtudiant(etud); // Act var result = repoEtudiants.NombreCoursInscrits(etud.EtudiantID); // Assert Assert.Equal(expected: 0, actual: result); }