1 package org.robolectric.shadows; 2 3 import static org.junit.Assert.assertFalse; 4 import static org.junit.Assert.assertTrue; 5 6 import android.widget.ViewFlipper; 7 import androidx.test.core.app.ApplicationProvider; 8 import androidx.test.ext.junit.runners.AndroidJUnit4; 9 import org.junit.Before; 10 import org.junit.Test; 11 import org.junit.runner.RunWith; 12 13 @RunWith(AndroidJUnit4.class) 14 public class ShadowViewFlipperTest { 15 protected ViewFlipper flipper; 16 17 @Before 18 public void setUp() { 19 flipper = new ViewFlipper(ApplicationProvider.getApplicationContext()); 20 } 21 22 @Test 23 public void testStartFlipping() { 24 flipper.startFlipping(); 25 assertTrue("flipping", flipper.isFlipping()); 26 } 27 28 @Test 29 public void testStopFlipping() { 30 flipper.stopFlipping(); 31 assertFalse("flipping", flipper.isFlipping()); 32 } 33 } 34