Code example for Configuration

0
    private Configuration configuration;
    private ShadowConfiguration shConfiguration;
 
    @Before 
    public void setUp() throws Exception { 
        configuration = new Configuration();
        shConfiguration = Robolectric.shadowOf( configuration );
    } 
 
    @Test 
    public void testSetToDefaults() throws Exception { 
        configuration.setToDefaults();
        assertThat(configuration.screenLayout).isEqualTo(Configuration.SCREENLAYOUT_LONG_NO | Configuration.SCREENLAYOUT_SIZE_NORMAL);
    } 
     
    @Test 
    public void testSetLocale() { 
    	shConfiguration.setLocale( Locale.US );
        assertThat(configuration.locale).isEqualTo(Locale.US);
 
    	shConfiguration.setLocale( Locale.FRANCE);