Exemple #1
0
        public void AverageAgeTest()
        {
            List <User> listOfUsers = new List <User>();

            listOfUsers.Add(new User("Any", "Novik", User.SexOfAPerson.female, 18));
            listOfUsers.Add(new User("Natasha", "Lesh", User.SexOfAPerson.female, 64));
            listOfUsers.Add(new User("Ivan", "Morz", User.SexOfAPerson.male, 25));
            listOfUsers.Add(new User("Vlad", "Sed", User.SexOfAPerson.male, 40));
            listOfUsers.Add(new User("Natasha", "Lok", User.SexOfAPerson.female, 24));
            listOfUsers.Add(new User("Natasha", "Les", User.SexOfAPerson.female, 52));
            CommandReceiver receiver    = new CommandReceiver(listOfUsers);
            int             actualValue = receiver.SearchUsersAverageAge();

            Assert.AreEqual(37, actualValue);
        }
Exemple #2
0
 public void Execute()
 {
     averageAge = receiver.SearchUsersAverageAge();
     Console.WriteLine($"Average users' age is {averageAge}");
 }