public void SetUp()
 {
     _people = new People.People();
     _mockCreditDecisionService = new Mock <IPerson>();
     _mockCoinRelease           = new Mock <ICoinRelease>();
     _returner = new ChangeReturner(_mockCoinRelease.Object);
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var peopleList = new People[7];

            int massivePosotion = 0;

            while (true)
            {
                Console.Clear();
                Console.WriteLine("Your can create seven person");
                Console.WriteLine("Do you want create people? Print Y if you want ");
                var answer = Console.ReadLine();

                if (answer != "Y")
                {
                    break;
                }

                Console.WriteLine("Write name");
                var name = Console.ReadLine();

                Console.WriteLine("Write age");
                var age = Convert.ToInt32(Console.ReadLine());

                if (age > 100 && age < 0)
                {
                    Console.WriteLine("No valid age");
                    continue;
                }

                Console.WriteLine("Choose gender 0 - male, 1 - feemale");
                var    gender = Console.ReadLine();
                Gendre genderType;

                switch (gender)
                {
                case "1":
                    genderType = Gendre.Female;
                    break;

                case "2":
                    genderType = Gendre.Male;
                    break;

                default:
                    Console.WriteLine("Unknown gender type");
                    continue;
                }

                var person = new People(age, name, genderType);
                peopleList[massivePosotion] = person;

                massivePosotion++;
                if (massivePosotion > 6)
                {
                    Console.WriteLine("Massive is full");
                    break;;
                }
            }

            SortByAge(peopleList);

            foreach (var people in peopleList)
            {
                if (people != null)
                {
                    people.GetInfo();
                }
            }

            Console.ReadKey();
        }