public void TestMethod3() { Pupil p = new Pupil("Julien", 21); var evaluation = p.GetEvaluationFor("bidon"); Assert.AreEqual('d', evaluation); }
public void TestMethod2() { Pupil p = new Pupil("Julien", 21); p.AddEvaluation(null, 'd'); var evaluation = p.GetEvaluationFor(null); Assert.AreEqual('d', evaluation); }
public void TestMethod1() { Pupil p = new Pupil("Julien",21); p.AddEvaluation("env dev", 'd'); var evaluation = p.GetEvaluationFor("env dev"); Assert.AreEqual('d', evaluation); }
public void TestMethod1() { //AAA //1. Arrange => Instancie Pupil p = new Pupil("pupil1", 20, 1); Activity a = new Activity("act2", true); //2. Act => On utilise p.AddActivity(a); p.AddEvaluation("act2", 'd'); //3. Assert => On compare résultat obtenu et on compare var evaluation = p.GetEvaluationFor("act2"); Assert.AreEqual('d', evaluation); }
public void TestForException() { //AAA //1.Arrange Pupil p = new Pupil("pupil1", 20, 1); Activity a = new Activity("act2", true); //2.Act p.AddActivity(a); p.AddEvaluation("act2", 'd'); //3.Assert var evaluation = p.GetEvaluationFor("act3"); Assert.AreEqual('d', evaluation); }
static void Main(string[] args) { Pupil elv1 = new Pupil("Ginetti", 22,1); Activity act1 = new Activity("Math", true); Activity act2 = new Activity("Rel", false); Activity act3 = new Activity("Anglais", true); elv1.AddActivity(act1); elv1.AddActivity(act2); elv1.AddActivity(act3); System.Console.Write(elv1); System.Console.Read(); }
public void ThrowsExceptionOrNot() { //AAA //Arrange -> Instancie Pupil p1 = new Pupil("Jean-Foupahune", 11); //Act -> Utilisation du système (fct) var evaluation = p1.getEvaluationFor("env dev"); //Assert -> Comparaison des résultats attendus et obtenus Assert.AreEqual('d', evaluation); }
public void TestMethod1() { //AAA //Arrange -> Instancie Pupil p1 = new Pupil("Jean-Foupahune", 11); //Act -> Utilisation du système (fct) p1.AddEvalutaion("env dev", 'd'); var evaluation = p1.getEvaluationFor("env dev"); //Assert -> Comparaison des résultats attendus et obtenus Assert.AreEqual('d', evaluation); }
static void Main(string[] args) { Pupil aurel = new Pupil("Aurel", 6, 1); Pupil quentin = new Pupil("Quentin", 22, 1); Pupil paul = new Pupil("Paul", 5, 1); Person maxime = new Person("Maxime", 10); Person chris = new Person("Chris", 2); Pupil aurel2 = new Pupil("Aurel", 6, 1); Pupil quentin2 = new Pupil("Quentin", 22, 1); Pupil jean = new Pupil("Jean", 5, 1); List<Person> listPersons = new List<Person>(); List<Pupil> listPupils = new List<Pupil>(); List<Pupil> listPupilsDuplicated = new List<Pupil>(); listPupilsDuplicated.Add(aurel2); listPupilsDuplicated.Add(quentin2); listPupilsDuplicated.Add(jean); //{ // new Pupil("Aurel", 6, 1); // new Pupil("Quentin", 22, 1); // new Pupil("Paul", 5, 1); //} listPupils.Add(aurel); listPupils.Add(quentin); listPupils.Add(paul); listPersons.Add(maxime); listPersons.Add(chris); var listFusion = listPersons.Union(listPupils); IEnumerable<Pupil> listPupilsNoDuplicated = listPupilsDuplicated.Distinct<Pupil>(new PersonComparer()); foreach (var pers in listPupilsNoDuplicated) { System.Console.Write(pers); } Debug. System.Console.Read(); Activity act1 = new Activity("coloriage", true); Activity act2 = new Activity("français", false); Activity act3 = new Activity("sieste", true); //aurel.AddActivity(act1); //aurel.AddActivity(act2); //aurel.AddActivity(act3); aurel.AddActivity("français"); aurel.AddActivity("sieste"); aurel.AddEvaluation("coloriage"); aurel.AddEvaluation(evaluation: 'T', title: "sieste"); // var pupilGrade1Plus6 = from pupil in listPupils // where pupil.Grade == 1 && pupil.Age >= 6 // select pupil; var pupilGrade1Plus6 = listPupils.FindAll(p => p.Grade == 1 && p.Age >= 6); if (pupilGrade1Plus6 != null) { foreach (var pupil in pupilGrade1Plus6) { System.Console.Write(pupil); } } //System.Console.Write(aurel); System.Console.Read(); }