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 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);
        }
        public void TeamUserCollectionNull()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = null;

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

            teamHandler.AddTeam(team);
        }
Exemple #4
0
        public void TeamNull()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);
            usersInTeam          = new List <User>();

            usersInTeam.Add(administratorCreator);

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

            anotherTeam = null;

            Assert.IsFalse(team.Equals(anotherTeam));
        }
        public void TextBoxBlackboardNull()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);
            usersInTeam.Add(administratorCreator);

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

            textBox = DataCreation.CreateTextBox(administratorCreator, null, widthOk, heightOk, originPointOk, contentOk, fontOk, fontSizeOk);

            textBoxHandler.AddElement(textBox);
        }
        public void TeamInvalidDate()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            DateTime invalidCreationDate = new DateTime(2020, 1, 1);

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

            teamHandler.AddTeam(team);
        }
Exemple #7
0
        public void ImageBlackboardNull()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(administratorCreator);

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

            image = DataCreation.CreateImage(administratorCreator, null, widthOk, heightOk, originPointOk, urlOk, formatOk);

            imageHandler.AddElement(image);
        }
        public void TeamMaxUsersZero()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            int invalidMaxUsers = 0;

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

            teamHandler.AddTeam(team);
        }
        public void TeamNullDescription()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            string invalidDescription = null;

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

            teamHandler.AddTeam(team);
        }
        public void TeamEmptyName()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            string invalidName = "";

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

            teamHandler.AddTeam(team);
        }
        public void BlackboardWithoutTeam()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(administratorCreator);

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

            blackboard = DataCreation.CreateBlackboard(blackboardNameOk, blackboardDescriptionOk, heightOk, widthOk, administratorCreator, null);

            blackboardHandler.AddBlackboard(blackboard);
        }
        public void BlackbordDifferentNameAndSameTeam()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);
            usersInTeam.Add(administratorCreator);

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

            blackboard1 = DataCreation.CreateBlackboard(blackboardNameOk, blackboardDescriptionOk, heightOk, widthOk, administratorCreator, teamOwner);

            blackboard2 = DataCreation.CreateBlackboard(anotherBlackboardNameOk, blackboardDescriptionOk, heightOk, widthOk, administratorCreator, teamOwner);

            Assert.IsFalse(blackboard1.Equals(blackboard2));
        }
        public void BlackboardDescriptionToLong()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(administratorCreator);

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

            string invalidDescription = "This is not a valid description because it is to long, you can write max 50 letters";

            blackboard = DataCreation.CreateBlackboard(blackboardNameOk, invalidDescription, heightOk, widthOk, administratorCreator, teamOwner);

            blackboardHandler.AddBlackboard(blackboard);
        }
        public void AddTheSameTeam()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            administratorHandler.AddAdministrator(administratorCreator);

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

            teamHandler.AddTeam(team);

            teamHandler.AddTeam(team);
        }
        public void BlackboardNameToLong()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(administratorCreator);

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

            string invalidName = "This name is not valid because it is too long";

            blackboard = DataCreation.CreateBlackboard(invalidName, blackboardDescriptionOk, heightOk, widthOk, administratorCreator, teamOwner);

            blackboardHandler.AddBlackboard(blackboard);
        }
        public void BlackboardOkCreatedByAdministrator()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(administratorCreator);

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

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

            blackboardPersistence.AddBlackboard(blackboard);

            Assert.AreEqual(blackboardNameOk, blackboard.name);
        }
        public void TextBoxNull()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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);

            textBox = DataCreation.CreateTextBox(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, contentOk, fontOk, fontSizeOk);

            anotherTextBox = null;

            Assert.IsFalse(textBox.Equals(anotherTextBox));
        }
        public void TextBoxOkCreatedByAdministrator()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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);

            textBox = DataCreation.CreateTextBox(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, contentOk, fontOk, fontSizeOk);

            textBoxHandler.AddElement(textBox);

            Assert.AreEqual(textBox, textBoxHandler.GetElementFromCollection(textBox.id, textBox.blackboardOwner));
        }
Exemple #19
0
        public void ImageOkCreatedByAdministrator()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, urlOk, formatOk);

            imageHandler.AddElement(image);

            Assert.AreEqual(image, imageHandler.GetElementFromCollection(image.id, image.blackboardOwner));
        }
Exemple #20
0
        public void ImageCommentCollectionNull()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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(null, blackboardOwner, widthOk, heightOk, originPointOk, urlOk, formatOk);

            image.commentCollection = null;

            imageHandler.AddElement(image);
        }
        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);
        }
        public void TeamInvalidModificationOfDescriptionSize()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            administratorHandler.AddAdministrator(administratorCreator);

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

            teamHandler.AddTeam(team);

            string newDescription = "This is an invalid description size it passes the limit of 50 characters.";

            teamHandler.ModifyTeamDescription(team.name, newDescription);
        }
Exemple #23
0
        public void ImageFormatNotAccepted()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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);

            string invalidFormat = ".mp4";

            image = DataCreation.CreateImage(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, urlOk, invalidFormat);

            imageHandler.AddElement(image);
        }
Exemple #24
0
        public void ImageWidthGreaterThanBlackboardWidth()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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);

            int invalidWidth = 100;

            image = DataCreation.CreateImage(administratorCreator, blackboardOwner, invalidWidth, heightOk, originPointOk, urlOk, formatOk);

            imageHandler.AddElement(image);
        }
Exemple #25
0
        public void ImageSameIdAndSameBlackboard()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, urlOk, formatOk);

            anotherImage    = DataCreation.CreateImage(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, urlOk, formatOk);
            anotherImage.id = image.id;

            Assert.IsTrue(image.Equals(anotherImage));
        }
Exemple #26
0
        public void CommentUserCreatorNull()
        {
            usersInTeam = new List <User>();

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

            usersInTeam.Add(colaboratorCreator);

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

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

            textBox = DataCreation.CreateTextBox(administratorCreator, blackboard, imageWidthOk, imageHeightOk, originPointOk, contentOk, fontOk, fontSizeOk);

            comment = DataCreation.CreateComment(commentDescriptionOk, creationDateOk, null, textBox);

            commentHandler.AddComment(comment);
        }
        public void TeamInvalidModificationOfMaxUsersNegative()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            administratorHandler.AddAdministrator(administratorCreator);

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

            teamHandler.AddTeam(team);

            int newMax = -1;

            teamHandler.ModifyTeamMaxUsers(team.name, newMax);
        }
        public void TextBoxFontEmpty()
        {
            usersInTeam = new List <User>();

            administratorCreator = DataCreation.CreateAdministrator(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);

            string invalidFont = "";

            textBox = DataCreation.CreateTextBox(administratorCreator, blackboardOwner, widthOk, heightOk, originPointOk, contentOk, invalidFont, fontSizeOk);

            textBoxHandler.AddElement(textBox);
        }
Exemple #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);
        }
        public void TeamInvalidModificationOfDescriptionNull()
        {
            administratorCreator = DataCreation.CreateAdministrator(userNameOK, userSurnameOK, userMailOK, userPasswordOK, userBirthdayOk);

            usersInTeam = new List <User>();

            usersInTeam.Add(administratorCreator);

            administratorHandler.AddAdministrator(administratorCreator);

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

            teamHandler.AddTeam(team);

            string newDescription = null;

            teamHandler.ModifyTeamDescription(team.name, newDescription);
        }