Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 2
0
        public void ColaboratorMailNoName()
        {
            string invalidMail = "@gmail.com";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 3
0
        public void ColaboratorMailWithNoAt()
        {
            string invalidMail = "joacooribegmail.com";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 4
0
        public void ColaboratorNullMail()
        {
            string invalidMail = null;

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 5
0
        public void ColaboratorPasswordTooSmall()
        {
            string invalidPassword = "******";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 6
0
        public void ColaboratorPasswordNoLetters()
        {
            string invalidPassword = "******";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 7
0
        public void ColaboratorEmptyName()
        {
            string invalidName = "";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 8
0
        public void ColaboratorInvalidModification()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);
            colaboratorHandler.AddColaborator(colaborator);
            string newPassword = "";

            userHandler.ModifyPassword(colaborator.mail, newPassword);
        }
Ejemplo n.º 9
0
        public void ColaboratorSurnameWithSpecialCharacters()
        {
            string invalidSurname = "#@?_";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 10
0
        public void ColaboratorSurnameWithNumbers()
        {
            string invalidSurname = "0rib3";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 11
0
        public void ColaboratorSurnameWithOnlyEmptySpaces()
        {
            string invalidSurname = "     ";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 12
0
        public void ColaboratorSurnameWithSpacesInTheBegining()
        {
            string invalidSurname = "           Oribe";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 13
0
        public void ColaboratorNullSurname()
        {
            string invalidSurname = null;

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

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

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 15
0
        public void ColaboratorNameWithNumbers()
        {
            string invalidName = "J04c0";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 16
0
        public void ColaboratorSurnameWithMoreThanOneSpaceInTheMiddle()
        {
            string invalidSurname = "Oribe   Bajac";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 17
0
        public void ColaboratorPasswordNoNumbers()
        {
            string invalidPassword = "******";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 18
0
        public void ColaboratorOK()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);

            Assert.IsTrue(userPersistence.ExistsUser(userHandler.GetUserFromColecction(colaborator.mail)));
        }
Ejemplo n.º 19
0
        public void ColaboratorInvalidBirthDate()
        {
            DateTime invalidBirthday = new DateTime(9999, 1, 1);

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 20
0
        public void ColaboratorNameWithSpacesInTheBegining()
        {
            string invalidName = "     Joaco";

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

            colaboratorHandler.AddColaborator(colaborator);
        }
Ejemplo n.º 21
0
        public void ColaboratorNull()
        {
            colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaborator2 = null;

            Assert.IsFalse(colaborator1.Equals(colaborator2));
        }
Ejemplo n.º 22
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));
        }
Ejemplo n.º 23
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));
        }
Ejemplo n.º 24
0
        public void ColaboratorModification()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);
            colaboratorHandler.AddColaborator(colaborator);
            string newPassword = "******";

            userHandler.ModifyPassword(colaborator.mail, newPassword);
            Assert.AreEqual(newPassword, userHandler.GetUserFromColecction(colaborator.mail).password);
        }
Ejemplo n.º 25
0
        public void ColaboratorLoginUserNotExist()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);

            string notExistUser = "******";

            sessionHandler.LogInColaborator(notExistUser, colaborator.mail);
        }
Ejemplo n.º 26
0
        public void ColaboratorLoginWrongMail()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);

            string invalidMail = "invalidMail";

            sessionHandler.LogInColaborator(invalidMail, colaborator.password);
        }
Ejemplo n.º 27
0
        public void ColaboratorLoginOk()
        {
            colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk);

            colaboratorHandler.AddColaborator(colaborator);

            Session actualSession = sessionHandler.LogInColaborator(colaborator.mail, colaborator.password);

            Assert.AreEqual(colaborator.mail, actualSession.user.mail);
        }
Ejemplo n.º 28
0
        public void BlackboardOkCreatedByColaborator()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(colaboratorCreator);

            teamOwner = DataCreation.CreateTeam(teamNameOK, teamDateOK, administratorCreator, teamDescriptionOK, teamMaxUsersOK, usersInTeam);

            blackboard = DataCreation.CreateBlackboard(blackboardNameOk, blackboardDescriptionOk, heightOk, widthOk, colaboratorCreator, teamOwner);

            blackboardPersistence.AddBlackboard(blackboard);

            Assert.AreEqual(blackboardNameOk, blackboard.name);
        }
Ejemplo n.º 29
0
        public void ImageUserCreatorNotBelongingToTheTeam()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, anotherUserMailOk, userPasswordOK, userBirthdayOk);

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

            usersInTeam.Add(administratorCreator);

            teamOwner = DataCreation.CreateTeam(teamNameOK, teamDateOK, administratorCreator, teamDescriptionOK, teamMaxUsersOK, usersInTeam);

            blackboardOwner = DataCreation.CreateBlackboard(blackboardNameOk, blackboardDescriptionOk, blackboardHeightOk, blackboardWidthOk, administratorCreator, teamOwner);

            image = DataCreation.CreateImage(colaboratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, urlOk, formatOk);

            imageHandler.AddElement(image);
        }
Ejemplo n.º 30
0
        public void TeamUsersOverMax()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

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

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            usersInTeam.Add(colaboratorCreator);

            int maxUsers = 1;

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

            teamHandler.AddTeam(team);
        }