public void TheOldestUserTest() { 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.SearchOldestUser(); Assert.AreEqual(64, actualValue); }
public void Execute() { theOldestUser = receiver.SearchOldestUser(); Console.WriteLine($"the oldest user {theOldestUser} years old"); }