Ejemplo n.º 1
0
        public void LeaveClub()
        {
            var p1 = new Person("test", "test", USA);
            var p2 = new Person("test", "test", USA);
            var theClub = new Club();
            theClub.AddMember(p1);
            theClub.AddMember(p2);
            p1.Leave(theClub);

            assertIsConsistent(p2, theClub);
            Assert.AreEqual(0, p1.MemberOf.Count());
            Assert.AreEqual(1, theClub.Members.Count());
        }
Ejemplo n.º 2
0
        public void AddMember()
        {
            var p = new Person("test", "test", USA);
            var theClub = new Club();
            theClub.AddMember(p);

            assertIsConsistent(p, theClub);
        }
Ejemplo n.º 3
0
 public void Join(Club club)
 {
     if (!memberIn.Contains(club))
     {
         memberIn.Add(club);
         club.AddMember(this);
     }
 }
Ejemplo n.º 4
0
        public void ClubBuildTest()
        {
            AircraftTest      aircraftTest      = new AircraftTest();
            ClubAddMemberTest clubAddMemberTest = new ClubAddMemberTest();

            aircraftTest.AircraftBuild();
            club.AddAircraft(aircraftTest.aircraft);

            clubAddMemberTest.CreateMembers();
            foreach (var m in clubAddMemberTest.club.Members)
            {
                club.AddMember(m);
            }
        }
Ejemplo n.º 5
0
        public void MulitpleClubs()
        {
            var p1 = new Person("test", "test", USA);
            var p2 = new Person("test", "test", USA);
            var club1 = new Club();
            var club2 = new Club();
            p1.Join(club1);
            p1.Join(club2);
            club1.AddMember(p2);
            club2.AddMember(p2);

            assertIsConsistent(p1, club1);
            assertIsConsistent(p1, club2);
            assertIsConsistent(p2, club1);
            assertIsConsistent(p1, club2);
        }
        public async Task AddContactToClub(string clubName, Pilot pilot)
        {
            var exist    = _clubMemberRepository.AddPilot(pilot);
            var clubSpec = new ClubWithSpecification(clubName);

            Club club = await(_clubRepository.GetAllByIdAsync(clubSpec));

            //clubSpec = new ClubWithSpecification(clubName, ClubServiceSpec.IncludePhone);
            //club1 = club1 = (await _clubRepository.ListAsync(clubSpec));
            //clubSpec = new ClubWithSpecification(clubName, ClubServiceSpec.IncludeEmail);
            //club1 = club1 = (await _clubRepository.ListAsync(clubSpec));


            club.AddMember(pilot);



            await _clubRepository.AddAsync(club);
        }
        public async Task AddPilotToClub(string clubName, int pilotId)
        {
            var pilot = await _clubMemberRepository.GetByIdAsync(pilotId);

            var clubSpec = new ClubWithSpecification(clubName);

            Club club = await(_clubRepository.GetAllByIdAsync(clubSpec));

            //clubSpec = new ClubWithSpecification(clubName, ClubServiceSpec.IncludePhone);
            //club1 = club1 = (await _clubRepository.ListAsync(clubSpec));
            //clubSpec = new ClubWithSpecification(clubName, ClubServiceSpec.IncludeEmail);
            //club1 = club1 = (await _clubRepository.ListAsync(clubSpec));

            if (club != null)
            {
                club.AddMember(pilot);
            }



            await _clubRepository.AddAsync(club);
        }
Ejemplo n.º 8
0
 public void TestAddFirstMember()
 {
     _club.AddMember();
     Assert.AreEqual(1, _club.MemberCount, "member count should be 1");
     Assert.AreEqual(0, _club.Members[0].Id, "first member Id should be 0");
 }
        public void TestSerialization()
        {
            _club = new Club()
            {
                Members = new SortableBindingList <Member>()
            };
            var newMember = _club.AddMember();

            newMember.DateDeNaissance               = new DateTime(2005, 6, 25);
            newMember.DateEntreeClub                = new DateTime(2010, 9, 15);
            newMember.saisonN                       = true;
            newMember.saisonNmoins1                 = false;
            newMember.Nom                           = "Jeanniard";
            newMember.Prenom                        = "Matti";
            newMember.NomPere                       = "Jeanniard";
            newMember.PrenomPere                    = "Luc";
            newMember.NomMere                       = "Lazzaron";
            newMember.PrenomMere                    = "Laetitia";
            newMember.Commune                       = "Colombe";
            newMember.CodePostal                    = "38690";
            newMember.Adresse                       = "490 route du vieux clocher";
            newMember.EmailPere                     = "*****@*****.**";
            newMember.TelPere                       = "04.76.83.26.09";
            newMember.TelPortablePere               = "06.76.83.26.09";
            newMember.EmailMere                     = "*****@*****.**";
            newMember.TelMere                       = "04.79.09.43.43";
            newMember.TelPortableMere               = "06.79.09.43.43";
            newMember.Sexe                          = EasyJudoClub.Sexe.Masculin;
            newMember.LicenseNumber                 = "AAA";
            newMember.Ceinture                      = Ceinture.Blanche1Trait;
            newMember.CommisaireSportif             = true;
            newMember.Arbitre                       = false;
            newMember.Passeport                     = false;
            newMember.CertificatMedicalNomMedecin   = "Jean Docteur";
            newMember.CertificatMedicalTelMedecin   = "04.11.22.33.44";
            newMember.MoyenPaiementsLiquide         = "10";
            newMember.MoyenPaiementsCheque          = "20";
            newMember.MoyenPaiementsChequesVacances = "30";
            newMember.MoyenPaiementsChequierJeune   = "40";
            newMember.MoyenPaiementsCarteMRA        = "50";

            Club.Serialize(_club);
            Assert.IsTrue(File.Exists(Club.EASY_SPORT_CLUB_DB_FILE_NAME));

            var newClubFromDb     = Club.Deserialize();
            var firstMemberFromDB = _club.Members[0];

            Assert.AreEqual(new DateTime(2005, 6, 25), firstMemberFromDB.DateDeNaissance);
            Assert.AreEqual(new DateTime(2010, 9, 15), firstMemberFromDB.DateEntreeClub);
            Assert.AreEqual(true, firstMemberFromDB.saisonN);
            Assert.AreEqual(false, firstMemberFromDB.saisonNmoins1);
            Assert.AreEqual("Jeanniard", firstMemberFromDB.Nom);
            Assert.AreEqual("Matti", firstMemberFromDB.Prenom);
            Assert.AreEqual("Jeanniard", firstMemberFromDB.NomPere);
            Assert.AreEqual("Luc", firstMemberFromDB.PrenomPere);
            Assert.AreEqual("Lazzaron", firstMemberFromDB.NomMere);
            Assert.AreEqual("Laetitia", firstMemberFromDB.PrenomMere);
            Assert.AreEqual("Colombe", firstMemberFromDB.Commune);
            Assert.AreEqual("38690", firstMemberFromDB.CodePostal);
            Assert.AreEqual("490 route du vieux clocher", firstMemberFromDB.Adresse);
            Assert.AreEqual("*****@*****.**", firstMemberFromDB.EmailPere);
            Assert.AreEqual("04.76.83.26.09", firstMemberFromDB.TelPere);
            Assert.AreEqual("06.76.83.26.09", firstMemberFromDB.TelPortablePere);
            Assert.AreEqual("*****@*****.**", firstMemberFromDB.EmailMere);
            Assert.AreEqual("04.79.09.43.43", firstMemberFromDB.TelMere);
            Assert.AreEqual("06.79.09.43.43", firstMemberFromDB.TelPortableMere);
            Assert.AreEqual(EasyJudoClub.Sexe.Masculin, firstMemberFromDB.Sexe);
            Assert.AreEqual("AAA", firstMemberFromDB.LicenseNumber);
            Assert.AreEqual(Ceinture.Blanche1Trait, firstMemberFromDB.Ceinture);
            Assert.AreEqual(true, firstMemberFromDB.CommisaireSportif);
            Assert.AreEqual(false, firstMemberFromDB.Arbitre);
            Assert.AreEqual(false, firstMemberFromDB.Passeport);
            Assert.AreEqual("Jean Docteur", firstMemberFromDB.CertificatMedicalNomMedecin);
            Assert.AreEqual("04.11.22.33.44", firstMemberFromDB.CertificatMedicalTelMedecin);
            Assert.AreEqual("10", firstMemberFromDB.MoyenPaiementsLiquide);
            Assert.AreEqual("20", firstMemberFromDB.MoyenPaiementsCheque);
            Assert.AreEqual("30", firstMemberFromDB.MoyenPaiementsChequesVacances);
            Assert.AreEqual("40", firstMemberFromDB.MoyenPaiementsChequierJeune);
            Assert.AreEqual("50", firstMemberFromDB.MoyenPaiementsCarteMRA);
        }
Ejemplo n.º 10
0
 public void GivenIAmAMemberOfTheVideoClub()
 {
     _usuario = new User("Maxi", "Topp");
     _videoClub.AddMember(_usuario);
 }