コード例 #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)));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: TeamTest.cs プロジェクト: joacooribe/180521-198685
        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));
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        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));
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        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);
        }
コード例 #17
0
        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));
        }
コード例 #18
0
        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));
        }
コード例 #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));
        }
コード例 #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);
        }
コード例 #21
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);
        }
コード例 #22
0
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #25
0
ファイル: ImageTest.cs プロジェクト: joacooribe/180521-198685
        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));
        }
コード例 #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);
        }
コード例 #27
0
        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);
        }
コード例 #28
0
        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);
        }
コード例 #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);
        }
コード例 #30
0
        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);
        }