Code example for Account

0
 
    /** 
     * Test sorting of users that match login 
     */ 
    public void testLoginMatch() { 
        GitHubAccount account = new GitHubAccount(new Account("m", "t"),
                AccountManager.get(getContext()));
        UserComparator comparator = new UserComparator(account);
 
        assertTrue(comparator.compare(new User().setLogin("m"),
                new User().setLogin("a")) < 0); 
        assertTrue(comparator.compare(new User().setLogin("a"),
                new User().setLogin("m")) > 0); 
        assertTrue(comparator.compare(new User().setLogin("m"),
                new User().setLogin("z")) < 0); 
        assertTrue(comparator.compare(new User().setLogin("z"),
                new User().setLogin("m")) > 0); 
        assertEquals(
                0, 
                comparator.compare(new User().setLogin("m"),
                        new User().setLogin("m")));