Exemple #1
0
        private void SeedDeveloperList()
        {
            DevTeam Sharpies  = new DevTeam(1, "Sharpies", "Windows Forms", "C#");
            DevTeam coolbeans = new DevTeam(2, "Cool Beans", "Java Beans", "Java");
            DevTeam webbies   = new DevTeam(3, "Webbies", "MySQL Integration ", "PHP");

            _devTeamRepo.AddDevTeamToList(Sharpies);
            _devTeamRepo.AddDevTeamToList(coolbeans);
            _devTeamRepo.AddDevTeamToList(webbies);

            Developer flintstone = new Developer("Code Monkey", "Fred", "Flintstone", 1, true);
            Developer rubble     = new Developer("Jr. Coder", "Barney", "Rubble", 2, false);
            Developer jetson     = new Developer("Senior Coder", "George", "Jetson", 3, true);
            Developer smith      = new Developer("Senior Coder", "Megan", "Smith", 4, true);

            _developerRepo.AddDeveloperToList(flintstone);
            _developerRepo.AddDeveloperToList(rubble);
            _developerRepo.AddDeveloperToList(jetson);
            _developerRepo.AddDeveloperToList(smith);


            //we need to use the devTeam variables to add developers
            Sharpies.Developers.Add(flintstone);
            Sharpies.Developers.Add(rubble);
            coolbeans.Developers.Add(jetson);
            webbies.Developers.Add(smith);
        }
Exemple #2
0
        public void CreateNewTeam()
        {
            Console.Clear();

            DevTeam newDevTeam = new DevTeam();

            Console.WriteLine("Enter a Team Number for the new team:");
            newDevTeam.TeamID = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter a name for the new Team:");
            newDevTeam.TeamName = Console.ReadLine();

            _devTeamRepo.AddDevTeamToList(newDevTeam);

            Console.WriteLine("To add Developers to this team, enter 1. Press any other key to return to the menu.");

            string input = Console.ReadLine();

            switch (input)
            {
            case "1":
                AddTeamMember();
                break;

            default:
                Console.WriteLine("Returning to the menu...");
                break;
            }
        }
        public void Arrange()
        {
            List <string> list1 = new List <string>();

            list1.Add("George Washington");
            list1.Add("Ben Franklin");
            _repo    = new DevTeamRepo();
            _devteam = new DevTeam("Panthers", 321, list1);
            _repo.AddDevTeamToList(_devteam);
        }
        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);
        }
        private void AddNewDevTeam()
        {
            Console.Clear();
            DevTeam newDevTeam = new DevTeam();

            //Name
            Console.WriteLine("Enter the name of the DevTeam:");
            newDevTeam.TeamName = Console.ReadLine();

            //ID Number
            Console.WriteLine("Enter the unique ID number for the DevTeam:");
            newDevTeam.TeamID = Console.ReadLine();

            //Add to Team List
            DisplayAllDevs();
            Console.WriteLine("Please enter the ID number of the Developer you'd like to add to this team.");

            string    responseID = Console.ReadLine();
            Developer developer  = _DeveloperRepo.GetDeveloperByID(responseID);

            newDevTeam.DevTeamMembers.Add(developer);

            _DevTeamRepo.AddDevTeamToList(newDevTeam);
        }
Exemple #6
0
        //10. Create team
        private void CreateTeam()
        {
            DevTeam          newDevTeam       = new DevTeam();
            List <DevTeam>   listOfDevTeams   = _devTeamRepo.GetDevTeamList();
            List <Developer> listOfDevelopers = _developerRepo.GetDeveloperList();

            Console.Clear();
            //name
            Console.WriteLine("Enter the name of the new developer team:");
            string newName = Console.ReadLine();

            bool NotValidID = true;
            int  tempID;
            int  newNumber = 000;

            while (NotValidID)
            {
                tempID = RandomNumber(101, 999);
                foreach (DevTeam devteam in listOfDevTeams)
                {
                    if (tempID == devteam.TeamNumber)
                    {
                        tempID = RandomNumber(101, 999);
                    }
                }
                newNumber  = tempID;
                NotValidID = false;
            }
            string addDev = "1";

            Console.WriteLine($"Would you like to add developers to {newName}?\n" +
                              $"1. Yes\n" +
                              $"2. No");
            addDev = Console.ReadLine();
            List <int> memberListNum = new List <int>();

            if (addDev == "1")
            {
                Console.Clear();
                DisplayAllDevelopers();
                Console.WriteLine("Enter the ID numbers of the developers you would like to add.\n" +
                                  "Press return / enter between each developer's ID number\n" +
                                  "Enter 'Done' when complete\n");
                string addDevNum = Console.ReadLine();
                while (addDevNum != "Done")
                {
                    int intID = int.Parse(addDevNum);
                    memberListNum.Add(intID);
                    addDevNum = Console.ReadLine();
                }
            }
            List <string> memberList = new List <string>();

            foreach (int newID in memberListNum)
            {
                Developer newMember = _developerRepo.GetDeveloperByID(newID);
                memberList.Add(newMember.Name);
            }
            DevTeam newDev = new DevTeam(newName, newNumber, memberList);

            _devTeamRepo.AddDevTeamToList(newDev);
        }