@Test public void isAtLeastMarshmallow() throws Exception { ReflectionHelpers.setStaticField(Build.VERSION.class, SDK_INT_FIELD, Build.VERSION_CODES.M); Sdk sdk = new SdkImpl(); assertTrue(sdk.isAtLeastLollipopMR1()); assertTrue(sdk.isAtLeastMarshmallow()); assertFalse(sdk.isAtLeastCurrentDevelopmentVersion()); }
@Test public void isAtLeastKitKat() throws Exception { ReflectionHelpers.setStaticField( Build.VERSION.class, SDK_INT_FIELD, Build.VERSION_CODES.KITKAT); Sdk sdk = new SdkImpl(); assertTrue(sdk.isAtLeastJellyBeanMR2()); assertTrue(sdk.isAtLeastKitKat()); assertFalse(sdk.isAtLeastLollipop()); }
@Before public void setUp() { /* Make sure isVisibleOrLegacy doesn't return false due to legacy */ ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 18); ShadowAccessibilityNodeInfo.resetObtainedInstances(); }
public void __constructor__() { ReflectionHelpers.setStaticField( AccessibilityEvent.class, "CREATOR", ShadowAccessibilityEvent.CREATOR); }