Search in sources :

Example 1 with UserComparator

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);
}
Also used : Account(android.accounts.Account) UserComparator(com.github.pockethub.android.core.user.UserComparator)

Example 2 with UserComparator

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")));
}
Also used : Account(android.accounts.Account) UserComparator(com.github.pockethub.android.core.user.UserComparator)

Aggregations

Account (android.accounts.Account)2 UserComparator (com.github.pockethub.android.core.user.UserComparator)2