// Path: units/src/com/leandog/brazenhead/test/BrazenheadTestRunner.java
// public class BrazenheadTestRunner extends RobolectricTestRunner {
// 
//     public BrazenheadTestRunner(Class<?> testClass) throws InitializationError {
//         super(testClass, new File("../driver"));
//     }
//     
//     @Override
//     public Object createTest() throws Exception {
//         Object theTest = super.createTest();
//         MockitoAnnotations.initMocks(theTest);
//         return theTest;
//     }
//     
//     @Override
//     public void beforeTest(Method method) {
//         bindShadowClass(ShadowInstrumentationTestCase.class);
//     }
// 
// }
// 
// Path: driver/src/com/robotium/solo/BrazenheadSleeper.java
// public class BrazenheadSleeper extends Sleeper {
//     
//     @Override
//     public void sleep() {
//         super.sleep();
//     }
//     
//     @Override
//     public void sleepMini() {
//         super.sleepMini();
//     }
// }


import static org.mockito.Mockito.*;
import org.junit.*;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import android.app.Instrumentation;
import android.view.KeyEvent;
import android.widget.Spinner;
import com.leandog.brazenhead.test.BrazenheadTestRunner;
import com.robotium.solo.BrazenheadSleeper;
import com.robotium.solo.Solo;
            spinnerPresser.pressSpinnerItem(spinner, 0);
            verify(instrumentation).sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
        }
        
        @Test
        public void itCanMoveDownInTheSpinner() {
            spinnerPresser.pressSpinnerItem(spinner, 4);
            verify(instrumentation, times(INITIAL + 4)).sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
        }
        
        @Test
        public void itCanMoveUpInTheSpinner() {
            spinnerPresser.pressSpinnerItem(spinner, -4);
            verify(instrumentation, times(4)).sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_UP);
        }
        
        @Test
        public void itSelectsTheItemWhenFinished() {
            spinnerPresser.pressSpinnerItem(spinner, 1);
            verify(instrumentation).sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER);
        }
        
        @Test
        public void itSleepsForATinyBitBetweenEachMovement() {
            spinnerPresser.pressSpinnerItem(spinner, 7);
            verify(sleeper, times(7)).sleepMini();
        }
        
    }
    
// Path: units/src/com/leandog/brazenhead/test/BrazenheadTestRunner.java
// public class BrazenheadTestRunner extends RobolectricTestRunner {
// 
//     public BrazenheadTestRunner(Class<?> testClass) throws InitializationError {
//         super(testClass, new File("../driver"));
//     }
//     
//     @Override
//     public Object createTest() throws Exception {
//         Object theTest = super.createTest();
//         MockitoAnnotations.initMocks(theTest);
//         return theTest;
//     }
//     
//     @Override
//     public void beforeTest(Method method) {
//         bindShadowClass(ShadowInstrumentationTestCase.class);
//     }
// 
// }
// 
// Path: driver/src/com/robotium/solo/BrazenheadSleeper.java
// public class BrazenheadSleeper extends Sleeper {
//     
//     @Override
//     public void sleep() {
//         super.sleep();
//     }
//     
//     @Override
//     public void sleepMini() {
//         super.sleepMini();
//     }
// }


// Path: units/src/com/leandog/brazenhead/SpinnerPresserTest.java
import static org.mockito.Mockito.*;
import org.junit.*;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import android.app.Instrumentation;
import android.view.KeyEvent;
import android.widget.Spinner;
import com.leandog.brazenhead.test.BrazenheadTestRunner;
import com.robotium.solo.BrazenheadSleeper;
import com.robotium.solo.Solo;

            spinnerPresser.pressSpinnerItem(spinner, 0);
            verify(instrumentation).sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
        }
        
        @Test
        public void itCanMoveDownInTheSpinner() {
            spinnerPresser.pressSpinnerItem(spinner, 4);
            verify(instrumentation, times(INITIAL + 4)).sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
        }
        
        @Test
        public void itCanMoveUpInTheSpinner() {
            spinnerPresser.pressSpinnerItem(spinner, -4);
            verify(instrumentation, times(4)).sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_UP);
        }
        
        @Test
        public void itSelectsTheItemWhenFinished() {
            spinnerPresser.pressSpinnerItem(spinner, 1);
            verify(instrumentation).sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER);
        }
        
        @Test
        public void itSleepsForATinyBitBetweenEachMovement() {
            spinnerPresser.pressSpinnerItem(spinner, 7);
            verify(sleeper, times(7)).sleepMini();
        }
        
    }
    
    @RunWith(BrazenheadTestRunner.class)