Code example for RadioGroup

Methods: getChildCountgetCheckedRadioButtonId

0
        Assert.assertNotNull(this.activity);
        Assert.assertNotNull(this.filterOptionsRadioGroup);
        Assert.assertNotNull(this.okButton);
        Assert.assertNotNull(this.cancelButton);
 
        Assert.assertEquals(RADIO_BUTTON_COUNT, this.filterOptionsRadioGroup.getChildCount());
        Assert.assertEquals(NO_RADIO_BUTTON_CHECKED, this.filterOptionsRadioGroup.getCheckedRadioButtonId());
    } 
 
    /** 
     * Test that the title of the {@link Activity} is correct. 
     */ 
    public void testTitle() { 
        String title = this.activity.getTitle().toString();
        String filterOptionsTitle = this.activity.getString(R.string.filter_options_title);
 
        Assert.assertTrue(title.contains(filterOptionsTitle));
    } 
 
    /** 
     * Check that an error message is displayed when the user clicks the "OK"