Exemplo n.º 1
0
 public void TestMethod1()
 {
     //AAA
     //1. Arrange => on instancie
     Pupil p = new Pupil("Justing", 12);
     //2. Act => on utilise le système
     p.AddEvaluation("env dev", 'd');
     //3. Assert => on compare résultat obtenu et attendu
     var evaluation = p.GetEvaluationFor(null);
     Assert.AreEqual('d', evaluation);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Pupil p1 = new Pupil("Justin", 12);
            Activity a1 = new Activity("Faire ses devoirs", true);
            Activity a2 = new Activity("Aider ses camarades", false);
            Activity a3 = new Activity("dessin", true);

            p1.AddActivity(a2);
            p1.AddActivity(a1);
            p1.AddActivity(a3);

            p1.AddEvaluation(title: "dessin", evaluation: 'T');

            System.Console.Write(p1.ToString());
            System.Console.ReadKey();
            List<Pupil> lstEleves = new List<Pupil>
            {
                new Pupil("Xavier", 12, 1),
                new Pupil("Cedric", 13, 2),
                new Pupil("Damien", 12, 1),
                new Pupil("pierre", 12, 1),
                new Pupil("Bliff", 12, 1),
                new Pupil("Pomme", 12, 6),
                new Pupil("Alfred", 12, 6),
            };
            var pupilGrade1Plus6 = lstEleves.Where(eleve => eleve.Grade == 1 || eleve.Grade == 6);
            if (pupilGrade1Plus6 != null)
            {
                foreach (var pupil in pupilGrade1Plus6)
                {
                    System.Console.Write(pupil + "\r\n");
                    System.Console.ReadKey();
                }
            }
            System.Console.Write("\r\n\r\n");

            List<Pupil> listPupils = new List<Pupil>()
            {
                new Pupil("biloute", 21, 3),
                new Pupil("Armstrong", 22, 3),
                new Pupil("Gimmy", 12, 4),
                new Pupil("Xavier", 12, 1),
                new Pupil("Cedric", 13, 2),
                new Pupil("Damien", 12, 1),
                new Pupil("DAmienne", 20, 6),
                new Pupil("Browling", 15, 7),
                new Pupil("Pierre", 15, 5),

            };
            List<Pupil> listPersons = new List<Pupil>()
            {
                new Pupil("Jean", 11, 3),
                new Pupil("Dumont", 12, 3),
                new Pupil("Alain", 14, 4),
                new Pupil("Syril", 21, 1),
                new Pupil("Bob", 13, 2),
                new Pupil("Robert", 17, 1),
                new Pupil("Bobette", 17, 6),
                new Pupil("Dafuux", 16, 7),
                new Pupil("Zboubz", 19, 5),
            };
        }