public void UserSearchTest(string userName) { const string DEFAULT_SEARCHBOX_PLACEHOLDER_VALUE = "Search users"; // Preconditions LoginPage loginPage = Application.Get(ApplicationSourcesRepository.ChromeByIP()).Login(); UsersPage usersPage = loginPage.SuccessAdminLogin(UserRepository.Get().Admin()); // Test Steps // Step 1: Check default value of search box Input users name into search field Assert.AreEqual(DEFAULT_SEARCHBOX_PLACEHOLDER_VALUE, usersPage.GetUserSearchBoxText()); // Step 2: Enter user name into search box usersPage.SetValueToSearch(userName); // Step 3: Check if user name from test data are equal with user from table IList <User> actual = usersPage.GetUsersDataForTable(); IList <User> expected = actual.Where(item => item.GetName().Contains(userName)).ToList(); Assert.AreEqual(expected, actual); // Return to previous state loginPage = usersPage.GotoLogOut(); }