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); }
public void ColaboratorMailWithNoAt() { string invalidMail = "joacooribegmail.com"; colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, invalidMail, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
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); }
public void ColaboratorDifferentEmail() { colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk); colaborator2 = DataCreation.CreateColaborator(nameOK, surnameOK, anotherMailOK, passwordOK, birthdayOk); Assert.IsFalse(colaborator1.Equals(colaborator2)); }
public void ColaboratorInvalidModification() { colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); string newPassword = ""; userHandler.ModifyPassword(colaborator.mail, newPassword); }
public void ColaboratorEmptyName() { string invalidName = ""; colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorSurnameWithOnlyEmptySpaces() { string invalidSurname = " "; colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorSurnameWithNumbers() { string invalidSurname = "0rib3"; colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorNullSurname() { string invalidSurname = null; colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorSurnameWithSpacesInTheBegining() { string invalidSurname = " Oribe"; colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorNameWithMoreThanOneSpaceInTheMiddle() { string invalidName = "Joaco Sabe"; colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorNameWithNumbers() { string invalidName = "J04c0"; colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorNameWithSpacesInTheBegining() { string invalidName = " Joaco"; colaborator = DataCreation.CreateColaborator(invalidName, surnameOK, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorMailNoName() { string invalidMail = "@gmail.com"; colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, invalidMail, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorSurnameWithSpecialCharacters() { string invalidSurname = "#@?_"; colaborator = DataCreation.CreateColaborator(nameOK, invalidSurname, mailOK, passwordOK, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
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)); }
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)); }
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)); }
public void ColaboratorPasswordNoNumbers() { string invalidPassword = "******"; colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, invalidPassword, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorSameEmail() { colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk); colaborator2 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk); Assert.IsTrue(colaborator1.Equals(colaborator2)); }
public void ColaboratorPasswordNoLetters() { string invalidPassword = "******"; colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, invalidPassword, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }
public void ColaboratorNull() { colaborator1 = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, passwordOK, birthdayOk); colaborator2 = null; Assert.IsFalse(colaborator1.Equals(colaborator2)); }
public void ColaboratorPasswordTooSmall() { string invalidPassword = "******"; colaborator = DataCreation.CreateColaborator(nameOK, surnameOK, mailOK, invalidPassword, birthdayOk); colaboratorHandler.AddColaborator(colaborator); }