Esempio n. 1
0
        } //end of ViewAllDeveloperTeams

        private void ViewDeveloperInfo(DevTeam devTeam)
        {
            foreach (var developer in devTeam.Developers)
            {
                Console.WriteLine($"Developer Id: {developer.EmployeeId}\n" +
                                  $"Developer Title: {developer.Title}\n" +
                                  $"Developer Name: {developer.FirstName} {developer.LastName}\n" +
                                  $"Developer HasPluralsight: {developer.PluralsightAccess}\n" +
                                  $"");
            }
        }
Esempio n. 2
0
        private void ViewDeveloperTeamByTeamID()
        {
            Console.Clear();
            Console.WriteLine("Please input developer team ID.");

            int inputDevTeamID = Convert.ToInt32(Console.ReadLine());

            DevTeam devTeam = _devTeamRepo.GetDevTeamByID(inputDevTeamID);

            DisplayDevTeamInfo(devTeam);
        }
Esempio n. 3
0
        public void SetTeamMember_ShouldSetCorrectString()
        {
            DevTeam content = new DevTeam();

            content.TeamMember = "team";

            string expected = "team";
            string actual   = content.TeamMember;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 4
0
        public void UpdateExistingContent_ShouldReturnTrue()
        {
            //arrange
            //testinitialize
            DevTeam newContent = new DevTeam("ben", 1, true);

            //act
            bool updateResult = _repo.UpdateExistingContent("ben", newContent);

            // assert
            Assert.IsTrue(updateResult);
        }
Esempio n. 5
0
        public void UpdateExistingContent_ShouldMatchGivenBool(string originalName, bool shouldUpdate)
        {
            //arrange
            //testinitialize
            DevTeam newContent = new DevTeam("ben", 1, true);

            //act
            bool updateResult = _repo.UpdateExistingContent(originalName, newContent);

            // assert
            Assert.AreEqual(shouldUpdate, updateResult);
        }
Esempio n. 6
0
        public void CreateNewTeam()
        {
            Console.WriteLine("Team name:");
            string teamName = Console.ReadLine();

            Console.WriteLine("Team ID:");
            string  teamIDAsString = Console.ReadLine();
            int     teamID         = int.Parse(teamIDAsString);
            DevTeam devTeam        = new DevTeam(teamID, teamName);

            _allDevTeams.AddTeam(devTeam);
        }
Esempio n. 7
0
        //View existing Developer by ID
        private void DisplayTeamById()
        {
            Console.Clear();
            //Prompt user to give title
            Console.WriteLine("Enter the id of the team you'd like to see:");

            //get the user's input
            string teamId    = Console.ReadLine();
            int    teamidint = Convert.ToInt16(teamId);

            //Find the content by title
            DevTeam devTeam = _developerTeamRepo.GetDevTeamById(teamidint);

            //Display Team if it isn't null
            if (devTeam != null)
            {
                Console.WriteLine($"Team ID: {devTeam.TeamId}\n" +
                                  $", Team Description: {devTeam.TeamDescription}\n" +
                                  $", Active: {devTeam.TeamActive}");
                bool Employees;
                int  emp = _developerTeamRepo.AreDevlopers(teamidint);
                if (emp == 0)
                {
                    Employees = false;
                }
                else
                {
                    Employees = true;
                }
                Console.WriteLine($"*********LIST OF EMPLOYEES**********\n");
                if (Employees)
                {
                    foreach (Developer developer in devTeam.Employees)
                    {
                        Console.WriteLine($"Employee ID: {developer.EmployeeId}\n" +
                                          $", Name: {developer.EmployeeName}\n" +
                                          $", Team ID: {developer.DevTeamId}\n" +
                                          $", Plural Licence: {developer.PluralsightLicence}\n" +
                                          $", Start Date: {developer.StartDate}\n" +
                                          $", Active: {developer.ActiveEmplyoee}\n\n");
                    }
                }
                else
                {
                    Console.WriteLine("No Employees in Team!!\n");
                }
            }
            else
            {
                Console.WriteLine($"TeamId [{teamId}] not found.");
            }
        }
Esempio n. 8
0
        private void CreateNewTeam()
        {
            DevTeam newDevTeam = new DevTeam();

            Console.WriteLine("Enter the id number of the team of developers");
            string idAsString = Console.ReadLine();
            int    idAsInt    = int.Parse(idAsString);

            newDevTeam.Id = idAsInt;

            Console.WriteLine("Enter the name of the team.");
            newDevTeam.TeamName = Console.ReadLine();
        }
Esempio n. 9
0
        private void AddNewTeam()
        {
            Console.Clear();
            //Name
            Console.WriteLine("Enter team name:");
            string name = Console.ReadLine();

            DevTeam newTeam = new DevTeam();

            newTeam.TeamName = name;

            _devTeamRepo.AddTeamToList(newTeam);
        }
        public void AddMemList_ShouldAddMemberList()
        {
            DevTeam actual = new DevTeam();
            //actual.Members.Add("Steve McQueen");
            //actual.Members.Add("John Wayne");

            List <string> expected = new List <string>();

            expected.Add("Steve McQueen");
            expected.Add("John Wayne");

            //CollectionAssert.AreEquivalent(expected, actual.Members);
        }
Esempio n. 11
0
        private void CreateTeam()
        {
            DevTeam newTeam = new DevTeam();

            Console.WriteLine("Enter the Name of the Team:");
            newTeam.TeamName = Console.ReadLine();
            Console.WriteLine("Enter the Team ID number:");
            string teamIDString = Console.ReadLine();
            int    newTeamID    = int.Parse(teamIDString);

            newTeam.TeamID = newTeamID;
            Console.WriteLine("Add Team Members from Main Menu.");
        }
Esempio n. 12
0
        public void displayAllMembersOnTeamWithID()
        {
            Console.WriteLine("What Team id: ");
            string teamIdAsString = Console.ReadLine();
            int    teamID         = int.Parse(teamIdAsString);

            DevTeam targetTeam = findTeamInRepoById(teamID);

            if (!(targetTeam == null))
            {
                DisplayTeamMembers(targetTeam);
            }
        }
Esempio n. 13
0
        private void AddDevTeam()
        {
            Console.Clear();
            DevTeam newDevTeam = new DevTeam();

            Console.WriteLine("Enter Developer Team Color:");
            newDevTeam.DevTeamColor = Console.ReadLine();

            Console.WriteLine("Enter Developer Team ID:");
            string devTeamIdAsString = Console.ReadLine();

            newDevTeam.DevTeamID = int.Parse(devTeamIdAsString);
        }
Esempio n. 14
0
        // Add developer to development team
        private void AddDeveloperToTeam()
        {
            Console.Clear();


            // Prompt the user to give a Team ID
            Console.WriteLine("Enter the TeamID of the team you'd like to add a developer to.");

            // Get the user's input
            string teamID = Console.ReadLine();
            int    group  = int.Parse(teamID);

            // Find the team by TeamID
            DevTeam team = _teamRepo.GetDevTeamByID(group);

            // Display team if TeamID isn't null
            if (team != null)
            {
                Console.WriteLine($"IDNumber:{team.TeamID}\n" +
                                  $"Team Name: {team.TeamName}");


                if (team.ListOfDevelopers != null)
                {
                    foreach (Developer teamMember in team.ListOfDevelopers)
                    {
                        Console.WriteLine($"Team Member: {teamMember}");
                    }
                }
                else
                {
                    Console.WriteLine("No team members exist");
                }


                DisplayAllDevelopers();

                Console.WriteLine("Type in Developer ID of the developer you would like to add to the team.");
                string           programmer  = Console.ReadLine();
                int              developerID = int.Parse(programmer);
                List <Developer> devs        = _programmerRepo.GetDeveloperList();

                foreach (Developer contractor in devs)
                {
                    if (contractor.IDNumber == developerID)
                    {
                        _teamRepo.AddDeveloperToTeam(contractor, team);
                    }
                }
            }
        }
Esempio n. 15
0
        //Display Developers on a Chosen Team
        private void ListDevelopersFromSelectedTeam()
        {
            //List the teams and then ask the user for input
            DisplayAllTeams();

            //Display list of developer names for the team.
            int     teamSelectionAsInt = int.Parse(Console.ReadLine());
            DevTeam teamSelection      = _devTeamRepo.GetTeamByGroupNumber(teamSelectionAsInt);

            foreach (Developer developer in teamSelection.ListOfDevelopers)
            {
                Console.WriteLine(developer.DeveloperName);
            }
        }
Esempio n. 16
0
        public bool CreateDevTeam(DevTeamCreate model)
        {
            var entity = new DevTeam()
            {
                OwnerId  = _userId,
                TeamName = model.TeamName
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.DevTeams.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
        public void UpdateExistingContent_ShouldReturnTrue()
        {
            //Arrange
            List <string> list2 = new List <string>();

            list2.Add("Abe Lincoln");
            list2.Add("Teddy Roosevelt");
            DevTeam newDevTeam = new DevTeam("Patriots", 776, list2);
            //Act
            bool updateResult = _repo.UpdateExistingDevTeam("Panthers", newDevTeam);

            //Assert
            Assert.IsTrue(updateResult);
        }
        public void UpdateExistingContent_ShouldMatchGivenBool(string originalName, bool shouldUpdate)
        {
            //Arrange
            List <string> list2 = new List <string>();

            list2.Add("Abe Lincoln");
            list2.Add("Teddy Roosevelt");
            DevTeam newDevTeam = new DevTeam("Patriots", 776, list2);
            //Act
            bool updateResult = _repo.UpdateExistingDevTeam(originalName, newDevTeam);

            //Assert
            Assert.AreEqual(shouldUpdate, updateResult);
        }
Esempio n. 19
0
        private void CreateATeam()
        {
            Console.Clear();

            DevTeam newTeam = new DevTeam();

            Console.WriteLine("Enter name of team:");
            newTeam.TeamName = Console.ReadLine().ToLower();

            Console.WriteLine("Enter in the Team's ID:");
            newTeam.TeamID = Console.ReadLine().ToLower();

            _teamList.AddNewTeam(newTeam);
        }
Esempio n. 20
0
        // View Dev Team by ID
        private void DisplayDevTeamById()
        {
            Console.Clear();

            // Prompt user to give the DevTeam ID
            Console.WriteLine("Enter the Team ID you would like to see:");

            // Get the user's input
            int teamId = Convert.ToInt16(Console.ReadLine());


            // Find the dev team by that ID
            DevTeam devTeam = _devTeamRepo.GetTeamById(teamId);
        }
        public void Arrange()
        {
            Developer        johnSmith = new Developer("John Smith", 123, true, 1);
            Developer        joanJett  = new Developer("Joan Jett", 553, true, 1);
            List <Developer> teamOne   = new List <Developer>();

            teamOne.Add(johnSmith);
            teamOne.Add(joanJett);

            _repo    = new DevTeam_Repository();
            _content = new DevTeam("Code Magenta", 2, teamOne);

            _repo.AddTeamToList(_content);
        }
Esempio n. 22
0
        //See method
        private void seedContentList()
        {
            Developer Erik  = new Developer("1", 2, "Erik Baugues", true, new DateTime(2008, 3, 1), true);
            Developer Derek = new Developer("2", 2, "Derek Fenwick", true, new DateTime(2006, 8, 21), true);

            Developer Judy  = new Developer("3", 1, "Judy Salinger", true, new DateTime(2000, 1, 15), false);
            Developer Riley = new Developer("4", 3, "Riley Tatlock", true, new DateTime(2000, 1, 15), false);
            Developer Kayte = new Developer("5", 4, "Kayte SImon", true, new DateTime(2019, 2, 22), false);

            _developerDirectory.AddDeveloperToLists(Erik);
            _developerDirectory.AddDeveloperToLists(Derek);
            _developerDirectory.AddDeveloperToLists(Judy);
            _developerDirectory.AddDeveloperToLists(Riley);
            _developerDirectory.AddDeveloperToLists(Kayte);

            List <Developer> DeveloperList = new List <Developer>();

            DeveloperList.Add(Erik);
            DeveloperList.Add(Derek);

            DevTeam Developers = new DevTeam(DeveloperList, "Development", 2, true);

            _developerTeamRepo.AddToTeamsLists(Developers);

            List <Developer> HRList = new List <Developer>();

            HRList.Add(Judy);

            DevTeam HR = new DevTeam(HRList, "Human Resources", 1, true);

            _developerTeamRepo.AddToTeamsLists(HR);


            List <Developer> CSList = new List <Developer>();

            CSList.Add(Riley);

            DevTeam CS = new DevTeam(CSList, "Client Services", 3, true);

            _developerTeamRepo.AddToTeamsLists(CS);

            List <Developer> ProdList = new List <Developer>();

            ProdList.Add(Kayte);

            DevTeam Production = new DevTeam(ProdList, "Production", 4, true);

            _developerTeamRepo.AddToTeamsLists(Production);
        }
Esempio n. 23
0
        //5. Add a team
        private void CreateNewTeam()
        {
            DevTeam newTeam = new DevTeam();

            //team name, team ID
            Console.WriteLine("Enter a team name:");
            newTeam.TeamName = Console.ReadLine();

            Console.WriteLine("Enter a team ID:");
            newTeam.TeamID = Console.ReadLine();

            List <DevTeam> teams = _devTeamRepo.GetDevTeams();

            teams.Add(newTeam);
        }
        public void AddTeamToList_ShouldGetNotNull()
        {
            //Arrange
            DevTeam devTeam = new DevTeam();

            devTeam.TeamName = "Panther";
            DevTeamRepo repository = new DevTeamRepo();

            //Act
            repository.AddDevTeamToList(devTeam);
            DevTeam fromDirectory = repository.GetDevTeamByName("Panther");

            //Assert
            Assert.IsNotNull(fromDirectory);
        }
        public void AddToList_ShouldGetNull()
        {
            //Arrange
            DevTeam content = new DevTeam();

            content.TeamId = 3;
            DevTeam_Repository repository = new DevTeam_Repository();

            //Act
            repository.AddTeamToList(content);
            DevTeam contentFromDirectory = repository.GetTeamByDevTeamId(3);

            //Assert
            Assert.IsNotNull(contentFromDirectory);
        }
Esempio n. 26
0
        //create new dev team
        private void CreateNewDevTeam()
        {
            Console.Clear();

            DevTeam newDevTeam = new DevTeam();

            Console.WriteLine("Enter the name of the team");
            string teamName = Console.ReadLine();

            //team id number
            Console.WriteLine("Enter the team ID number:");
            string idAsString = Console.ReadLine();

            newDevTeam.TeamIDNum = int.Parse(idAsString);
        }
Esempio n. 27
0
        // Update existing Dev Team
        private void UpdateExistingDevTeam()
        {
            // Display All Teams
            ViewAllDevTeams();

            // Ask which Dev Team to update by Team Id
            Console.WriteLine("Enter the ID number of the Dev Team you wuoldl like to update:");

            // Get that Dev Team
            int oldIdNumber = int.Parse(Console.ReadLine());

            // Build a new object
            DevTeam newTeam = new DevTeam();

            // DevTeam ID
            Console.WriteLine("Enter the ID Number for the new Dev Team:");
            newTeam.DevTeamId = int.Parse(Console.ReadLine());

            // Dev Team Project Name
            Console.WriteLine("Enter the project name for the new Dev Team:");
            newTeam.DevTeamName = Console.ReadLine();

            // Developer known language
            Console.WriteLine("Enter the number for prefered known coding language for the project:\n" +
                              "1. C#\n" +
                              "2. JavaScript\n" +
                              "3. Python\n" +
                              "4. SQL\n" +
                              "5. Java");

            string languageAsString = Console.ReadLine();
            int    languageAsInt    = int.Parse(languageAsString);

            newTeam.PreferedLanguage = (CodingLanguagePrefered)languageAsInt;


            // Verify the Dev Team was updated
            bool wasUpdated = _teamRepo.UpdateExistingTeams(oldIdNumber, newTeam);

            if (wasUpdated)
            {
                Console.WriteLine("Dev Team was successfully updated!");
            }
            else
            {
                Console.WriteLine("Could not update Dev Team...");
            }
        }
Esempio n. 28
0
        //update existing content
        private void UpdateExistingContent()
        {
            //display all content
            DisplayAllContent();

            //ask for the name of the content to update
            Console.WriteLine("enter the name you would like to update:");
            //get the name
            string oldName = Console.ReadLine();

            DevTeam newContent = new DevTeam();

            //name
            Console.WriteLine("Enter your Name");
            newContent.TeamMember = Console.ReadLine();

            //identification number
            Console.WriteLine("Enter your ID number");
            string idAsString = Console.ReadLine();

            newContent.IdNumber = int.Parse(idAsString);


            //access to plural sight
            Console.WriteLine("Do they have access to pluralsight (y/n)");
            string pluralSightString = Console.ReadLine();

            if (pluralSightString == "y")
            {
                newContent.PluralSight = true;
            }
            else
            {
                newContent.PluralSight = false;
            }

            //verify the updated work
            bool wasUpdated = _contentRepo.UpdateExistingContent(oldName, newContent);

            if (wasUpdated)
            {
                Console.WriteLine("content successfully updated.");
            }
            else
            {
                Console.WriteLine("could not update.");
            }
        }
Esempio n. 29
0
        //Create new Dev Team

        private void CreateNewDevTeam()
        {
            Console.Clear();
            DevTeam newDevTeam = new DevTeam();

            //Name
            Console.WriteLine("Enter the developer team's name: ");
            newDevTeam.TeamName = Console.ReadLine();
            //ID
            Console.WriteLine("Enter the developer team's ID (xxxx): ");
            string idAsString = Console.ReadLine();

            newDevTeam.TeamID = int.Parse(idAsString);

            _devTeamRepo.AddDevTeam(newDevTeam.TeamName, newDevTeam.TeamID);
        }
Esempio n. 30
0
        private void ViewDevsInTeam()
        {
            Console.Clear();
            Console.WriteLine("Enter the Dev Team ID you'd like to view");
            int              devTeamToView    = int.Parse(Console.ReadLine());
            DevTeam          devTeam          = _devTeamRepo.GetDevTeamByID(devTeamToView);
            List <Developer> listOfDevelopers = devTeam._devTeam;

            foreach (Developer dev in listOfDevelopers)
            {
                Console.WriteLine($"Name: {dev.Name}\n" +
                                  $"Developer ID: {dev.DevID}\n" +
                                  $"Currently Using Pluralsight?: {dev.HasPluralsight}");
            }
            Console.ReadLine();
        }