public void TeamOKCreatedByAdministrator()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            colaboratorCreator = DataCreation.CreateColaborator(userNameOK, userSurnameOK, anotherUserMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            usersInTeam.Add(colaboratorCreator);

            administratorHandler.AddAdministrator(administratorCreator);

            colaboratorHandler.AddColaborator(colaboratorCreator);

            team = DataCreation.CreateTeam(nameOK, dateOK, administratorCreator, descriptionOK, maxUsersOK, usersInTeam);

            Team team1 = DataCreation.CreateTeam("team2", dateOK, administratorCreator, descriptionOK, maxUsersOK, usersInTeam);

            teamHandler.AddTeam(team);

            teamHandler.AddTeam(team1);

            Assert.IsTrue(teamPersistence.ExistsTeam(teamHandler.GetTeamFromCollection(team.name)));
        }
        public void LoadAdministratorsOk()
        {
            administrator = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            administrator1 = DataCreation.CreateAdministrator(nameOK, surnameOK, anotherMailOk, passwordOK, birthdayOk);

            administratorHandler.AddAdministrator(administrator);

            administratorHandler.AddAdministrator(administrator1);

            List <User> allUsers = new List <User>();

            allUsers.Add(administrator);

            allUsers.Add(administrator1);

            bool loadOk = true;

            foreach (User user in userHandler.LoadUsers())
            {
                if (!allUsers.Contains(user))
                {
                    loadOk = false;
                }
            }

            Assert.IsTrue(loadOk);
        }
        public void AdminisitratorGetTeamsOk()
        {
            administrator = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administrator);

            team = DataCreation.CreateTeam(teamNameOK, teamDateOK, administrator, descriptionOK, maxUsersOK, usersInTeam);

            administratorHandler.AddAdministrator(administrator);

            teamHandler.AddTeam(team);

            administrator.teams.Add(team);

            bool getTeamOk = true;

            foreach (Team teamFromUser in userHandler.GetTeams(administrator))
            {
                if (!administrator.teams.Contains(teamFromUser))
                {
                    getTeamOk = false;
                }
            }

            Assert.IsTrue(getTeamOk);
        }
Beispiel #4
0
        public void ColaboratorMailWithNoAt()
        {
            string invalidMail = "joacooribegmail.com";

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, invalidMail, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #5
0
        public void ColaboratorNullMail()
        {
            string invalidMail = null;

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, invalidMail, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
        public void AdministratorEmptyName()
        {
            string invalidName = "";

            administrator = DataCreation.CreateAdministrator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk);

            administratorHandler.AddAdministrator(administrator);
        }
Beispiel #7
0
        public void ColaboratorDifferentEmail()
        {
            colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaborator2 = DataCreation.CreateColaborator(nameOK, surnameOK, anotherMailOK, passwordOK, birthdayOk);

            Assert.IsFalse(colaborator1.Equals(colaborator2));
        }
Beispiel #8
0
        public void ColaboratorInvalidModification()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);
            colaboratorHandler.AddColaborator(colaborator);
            string newPassword = "";

            userHandler.ModifyPassword(colaborator.mail, newPassword);
        }
Beispiel #9
0
        public void ColaboratorEmptyName()
        {
            string invalidName = "";

            colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #10
0
        public void ColaboratorSurnameWithOnlyEmptySpaces()
        {
            string invalidSurname = "     ";

            colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #11
0
        public void ColaboratorSurnameWithNumbers()
        {
            string invalidSurname = "0rib3";

            colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #12
0
        public void ColaboratorNullSurname()
        {
            string invalidSurname = null;

            colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #13
0
        public void ColaboratorSurnameWithSpacesInTheBegining()
        {
            string invalidSurname = "           Oribe";

            colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #14
0
        public void ColaboratorNameWithMoreThanOneSpaceInTheMiddle()
        {
            string invalidName = "Joaco   Sabe";

            colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #15
0
        public void ColaboratorNameWithNumbers()
        {
            string invalidName = "J04c0";

            colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #16
0
        public void ColaboratorNameWithSpacesInTheBegining()
        {
            string invalidName = "     Joaco";

            colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #17
0
        public void ColaboratorMailNoName()
        {
            string invalidMail = "@gmail.com";

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, invalidMail, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #18
0
        public void ColaboratorSurnameWithSpecialCharacters()
        {
            string invalidSurname = "#@?_";

            colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #19
0
        public void ColaboratorInvalidBirthDate()
        {
            DateTime invalidBirthday = new DateTime(9999, 1, 1);

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, invalidBirthday);

            colaboratorHandler.AddColaborator(colaborator);
        }
        public void AdministratorSameEmail()
        {
            administrator1 = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            administrator2 = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            Assert.IsTrue(administrator1.Equals(administrator2));
        }
Beispiel #21
0
        public void ColaboratorOK()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);

            Assert.IsTrue(userPersistence.ExistsUser(userHandler.GetUserFromColecction(colaborator.mail)));
        }
        public void AdministratorNull()
        {
            administrator1 = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            administrator2 = null;

            Assert.IsFalse(administrator1.Equals(administrator2));
        }
Beispiel #23
0
        public void ColaboratorSurnameWithMoreThanOneSpaceInTheMiddle()
        {
            string invalidSurname = "Oribe   Bajac";

            colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
        public void AdminisitratorOK()
        {
            administrator = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            administratorHandler.AddAdministrator(administrator);

            Assert.IsTrue(userPersistance.ExistsUser(userHandler.GetUserFromColecction(administrator.mail)));
        }
        public void AdministratorDifferentEmail()
        {
            administrator1 = DataCreation.CreateAdministrator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            administrator2 = DataCreation.CreateAdministrator(nameOK, surnameOK, anotherMailOK, passwordOK, birthdayOk);

            Assert.IsFalse(administrator1.Equals(administrator2));
        }
Beispiel #26
0
        public void ColaboratorPasswordNoNumbers()
        {
            string invalidPassword = "******";

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, invalidPassword, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #27
0
        public void ColaboratorSameEmail()
        {
            colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaborator2 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            Assert.IsTrue(colaborator1.Equals(colaborator2));
        }
Beispiel #28
0
        public void ColaboratorPasswordNoLetters()
        {
            string invalidPassword = "******";

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, invalidPassword, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }
Beispiel #29
0
        public void ColaboratorNull()
        {
            colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaborator2 = null;

            Assert.IsFalse(colaborator1.Equals(colaborator2));
        }
Beispiel #30
0
        public void ColaboratorPasswordTooSmall()
        {
            string invalidPassword = "******";

            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, invalidPassword, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);
        }