@Test public void testClickFailure() throws Throwable { // deny permission only available since android marshmallow skipTestIfBelowAndroidMarshmallow(); exception.expect(IllegalStateException.class); espPermissionDialog.deny(); }
@Test public void testDeny() throws Throwable { whenRequestTestPermission(); espPermissionDialog.deny(); // deny permissions only available since android marshmallow if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { assertTestPermissionIsDenied(); } }
@Test public void testDenyWhenAllowedFailure() throws Throwable { // deny permission only available since android marshmallow skipTestIfBelowAndroidMarshmallow(); exception.expect(IllegalStateException.class); exception.expectMessage("Deny would revoke permission and restart app. This would let all following tests fail. See documentation for details."); whenRequestTestPermission(); espPermissionDialog.allow(); assertTestPermissionIsGranted(); espPermissionDialog.deny(); }