package permissions.dispatcher;

import android.Manifest;
import android.content.pm.PackageManager;
import android.test.AndroidTestCase;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static permissions.dispatcher.PermissionUtils.hasSelfPermissions;
import static permissions.dispatcher.PermissionUtils.verifyPermissions;

/**
 * Unit test for {@link PermissionUtils}.
 */
public class PermissionUtilsTest extends AndroidTestCase {

    @Test
    public void testVerifyPermissions() {
        assertThat(verifyPermissions(PackageManager.PERMISSION_GRANTED), is(true));
        assertThat(verifyPermissions(PackageManager.PERMISSION_GRANTED, PackageManager.PERMISSION_GRANTED), is(true));
        assertThat(verifyPermissions(1, 2, PackageManager.PERMISSION_GRANTED), is(false));
        assertThat(verifyPermissions(1, 2, 3), is(false));
    }

    @Test
    public void testHasSelfPermissions() {
        assertThat(hasSelfPermissions(getContext(), Manifest.permission.CAMERA), is(false));
    }

}

@@ -130,17 +130,16 @@
 stCase;%0A
-%0A
 import o
@@ -492,16 +492,91 @@
 Case %7B%0A%0A
+    private static final int GRANTED = PackageManager.PERMISSION_GRANTED;%0A%0A
     @Tes
@@ -660,34 +660,8 @@
 ons(
-PackageManager.PERMISSION_
 GRAN
@@ -718,69 +718,17 @@
 ons(
-PackageManager.PERMISSION_GRANTED, PackageManager.PERMISSION_
+GRANTED, 
 GRAN
@@ -791,34 +791,8 @@
  2, 
-PackageManager.PERMISSION_
 GRAN

Clean up test code.