1 package com.xtremelabs.robolectric.shadows; 2 3 import android.app.Activity; 4 import android.content.Context; 5 import android.widget.AbsSeekBar; 6 import com.xtremelabs.robolectric.Robolectric; 7 import com.xtremelabs.robolectric.WithTestDefaultsRunner; 8 import org.junit.Test; 9 import org.junit.runner.RunWith; 10 11 import static org.hamcrest.CoreMatchers.instanceOf; 12 import static org.junit.Assert.assertThat; 13 14 @RunWith(WithTestDefaultsRunner.class) 15 public class AbsSeekBarTest { 16 17 @Test testInheritance()18 public void testInheritance() { 19 TestAbsSeekBar seekBar = new TestAbsSeekBar(new Activity()); 20 ShadowAbsSeekBar shadow = Robolectric.shadowOf(seekBar); 21 assertThat(shadow, instanceOf(ShadowProgressBar.class)); 22 } 23 24 private static class TestAbsSeekBar extends AbsSeekBar { 25 TestAbsSeekBar(Context context)26 public TestAbsSeekBar(Context context) { 27 super(context); 28 } 29 } 30 } 31