use of com.github.pockethub.android.core.user.UserComparator in project PocketHub by pockethub.
the class UserComparatorTest method testNoLoginMatch.
/**
* Test sorting of users that don't match login
*/
public void testNoLoginMatch() {
Account account = new Account("m", "t");
UserComparator comparator = new UserComparator(account);
assertTrue(comparator.compare(createUser("a"), createUser("c")) < 0);
assertTrue(comparator.compare(createUser("db"), createUser("da")) > 0);
}
use of com.github.pockethub.android.core.user.UserComparator in project PocketHub by pockethub.
the class UserComparatorTest method testLoginMatch.
/**
* Test sorting of users that match login
*/
public void testLoginMatch() {
Account account = new Account("m", "t");
UserComparator comparator = new UserComparator(account);
assertTrue(comparator.compare(createUser("m"), createUser("a")) < 0);
assertTrue(comparator.compare(createUser("a"), createUser("m")) > 0);
assertTrue(comparator.compare(createUser("m"), createUser("z")) < 0);
assertTrue(comparator.compare(createUser("z"), createUser("m")) > 0);
assertEquals(0, comparator.compare(createUser("m"), createUser("m")));
}
Aggregations