Code example for Activity

Methods: get

0
    public void testGet() { 
        AccountManager appAM = AccountManager.get(app);
        assertThat(appAM).isNotNull();
        assertSame(AccountManager.get(app), appAM);
 
        Activity a = new Activity();
        assertThat(AccountManager.get(a)).isNotNull();
        assertThat(AccountManager.get(a)).isNotSameAs(appAM);
    } 
 
    @Test 
    public void testGetAccounts() { 
        AccountManager am = AccountManager.get(app);
        assertThat(am.getAccounts()).isNotNull();
        assertThat(am.getAccounts().length).isEqualTo(0);
 
        Account a1 = new Account("name_a", "type_a");
        Robolectric.shadowOf(am).addAccount(a1);
        assertThat(am.getAccounts()).isNotNull();
        assertThat(am.getAccounts().length).isEqualTo(1);
Connect your IDE to all the code out there  Get Codota for Java