1 package com.xtremelabs.robolectric.shadows; 2 3 import android.app.Activity; 4 import android.widget.Spinner; 5 import com.xtremelabs.robolectric.WithTestDefaultsRunner; 6 import org.junit.Before; 7 import org.junit.Test; 8 import org.junit.runner.RunWith; 9 10 import static org.hamcrest.CoreMatchers.is; 11 import static org.junit.Assert.assertThat; 12 13 @RunWith(WithTestDefaultsRunner.class) 14 public class SpinnerTest { 15 16 private Spinner spinner; 17 18 @Before 19 public void beforeTests() { 20 spinner = new Spinner(new Activity()); 21 } 22 23 @Test 24 public void testPrompt() { 25 spinner.setPrompt("foo"); 26 27 assertThat(spinner.getPrompt().toString(), is("foo")); 28 } 29 } 30