Ejemplo n.º 1
0
        public void TestParticipation()
        {
            ICoureurRepository       coureurs = new CoureurRepository();
            IParticipationRepository parts    = new ParticipationRepository();
            ICourseRepository        courses  = new CourseRepository();

            parts.DeleteALL();
            coureurs.DeleteALL();
            courses.DeleteALL();

            Coureur coureur1 = new Coureur("coureur1", "1", "XXXXXXXXX", "*****@*****.**", "X", DateTime.Today);

            Course course1 = new Course("", 42);

            Participation part1 = new Participation(coureur1, course1, 0, 42);

            coureur1.Participations.Add(part1);
            course1.Participations.Add(part1);

            coureurs.Save(coureur1);

            List <Coureur> result = coureurs.GetAll();

            Assert.IsTrue(result[0] == coureur1);

            coureurs.DeleteALL();
        }
Ejemplo n.º 2
0
        public void TestExist()
        {
            ICoureurRepository coureurs = new CoureurRepository();

            coureurs.DeleteALL();

            Coureur coureur1 = new Coureur("coureur1", "1", "XXXXXXXXX", "*****@*****.**", "X", DateTime.Today);

            coureurs.Save(coureur1);

            Assert.IsTrue(coureurs.Exist(coureur1));
        }
Ejemplo n.º 3
0
        public void TestDeleteAll()
        {
            ICoureurRepository coureurs = new CoureurRepository();

            Coureur coureur1 = new Coureur("coureur1", "1", "XXXXXXXXX", "*****@*****.**", "X", DateTime.Today);

            coureurs.Save(coureur1);
            Coureur coureur2 = new Coureur("coureur2", "2", "XXXXXXXXX", "*****@*****.**", "X", DateTime.Today);

            coureurs.Save(coureur2);

            coureurs.DeleteALL();

            List <Coureur> result = coureurs.GetAll();

            Assert.IsTrue(result.Count == 0);
        }