Esempio n. 1
0
        public void DefaultValues()
        {
            _repo    = new DevRepo();
            _content = new DevContent("Brittany Beahan", 2, true);

            _repo.AddDevToList(_content);
        }
Esempio n. 2
0
        public void AddDevToList_ShouldGetNotNull()
        {
            DevContent content    = new DevContent("Richard Torres", 1, true);
            DevRepo    repository = new DevRepo();

            repository.AddDevToList(content);
            DevContent contentfromDirectory = repository.GetDevContentByID(1);

            Assert.IsNotNull(contentfromDirectory);
        }
Esempio n. 3
0
        //Add new DevContent
        private void AddNewDev()
        {
            bool addAnotherDev = true;

            while (addAnotherDev == true)
            {
                Console.Clear();
                DevContent newDev = new DevContent();

                Console.WriteLine("What is the First and Last name of the developer:");
                newDev.FullName = Console.ReadLine();

                Console.WriteLine("What is the developers Identification Number:");
                string identAsInt = Console.ReadLine();
                newDev.IdentificationNumber = int.Parse(identAsInt);

                Console.WriteLine("Does this developer have Pluralsight access: (yes/no)");
                string yesNo = Console.ReadLine().Trim().ToLower();
                if (yesNo == "yes")
                {
                    newDev.AccessPlural = true;
                }
                else if (yesNo == "no")
                {
                    newDev.AccessPlural = false;
                }
                else
                {
                    Console.WriteLine("Incorrect value entered, Pluralsight defaulted to NO. If this is incorrect then please update developer data.");
                    newDev.AccessPlural = false;
                }

                _contentRepo.AddDevToList(newDev);

                Console.WriteLine("\nWould you like to add another user? (yes/no)");
                string addMoreDev = Console.ReadLine().Trim().ToLower();
                if (addMoreDev == "yes")
                {
                    addAnotherDev = true;
                }
                else
                {
                    addAnotherDev = false;
                }
            }
        }