Code example for Spinner

Methods: setAdapter

0
        AdapterViewBehavior.shouldActAsAdapterView(adapterView);
    } 
 
	@Test 
	public void checkSetAdapter() { 
		spinner.setAdapter(arrayAdapter);
	} 
 
	@Test 
	public void getSelectedItemShouldReturnCorrectValue(){ 
		spinner.setAdapter(arrayAdapter);
		spinner.setSelection(0);
        assertThat((String) spinner.getSelectedItem()).isEqualTo("foo");
        assertThat((String) spinner.getSelectedItem()).isNotEqualTo("bar");
		 
		spinner.setSelection(1);
        assertThat((String) spinner.getSelectedItem()).isEqualTo("bar");
		assertThat((String) spinner.getSelectedItem()).isNotEqualTo("foo");
	} 
	 
	@Test