From 0ad0a69b1c74a70b0aa53bb27d99816a45e5893b Mon Sep 17 00:00:00 2001 From: Lentumunai-Mark Date: Mon, 14 Oct 2024 11:25:38 +0300 Subject: [PATCH] Remove file. Signed-off-by: Lentumunai-Mark --- .../kujaku/helpers/PermissionsHelperTest.java | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 library/src/test/java/io/ona/kujaku/helpers/PermissionsHelperTest.java diff --git a/library/src/test/java/io/ona/kujaku/helpers/PermissionsHelperTest.java b/library/src/test/java/io/ona/kujaku/helpers/PermissionsHelperTest.java deleted file mode 100644 index b7f2483d..00000000 --- a/library/src/test/java/io/ona/kujaku/helpers/PermissionsHelperTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.ona.kujaku.helpers; - -import static org.junit.Assert.assertFalse; - -import android.app.Activity; -import android.content.Context; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.robolectric.Robolectric; -import org.robolectric.RobolectricTestRunner; -import com.karumi.dexter.MultiplePermissionsReport; -import io.ona.kujaku.utils.KujakuMultiplePermissionListener; - -@RunWith(RobolectricTestRunner.class) -public class PermissionsHelperTest { - - @Mock - Context mockContext; - - @Before - public void setUp() { - MockitoAnnotations.openMocks(this); - // Use a real context - mockContext = Robolectric.setupActivity(Activity.class).getApplicationContext(); - } - - @Test - public void testOnPermissionsCheckedWhenAnyPermissionPermanentlyDenied() { - MultiplePermissionsReport report = Mockito.mock(MultiplePermissionsReport.class); - Mockito.when(report.isAnyPermissionPermanentlyDenied()).thenReturn(true); - Mockito.when(report.areAllPermissionsGranted()).thenReturn(false); - KujakuMultiplePermissionListener listener = new KujakuMultiplePermissionListener(mockContext); - listener.onPermissionsChecked(report); - - // Check that the dialog was created with the expected properties - Mockito.verify(report).isAnyPermissionPermanentlyDenied(); - } - - @Test - public void testOnPermissionsCheckedWhenAnyPermissionNotPermanentlyDenied() { - MultiplePermissionsReport report = Mockito.mock(MultiplePermissionsReport.class); - Mockito.when(report.isAnyPermissionPermanentlyDenied()).thenReturn(false); - Mockito.when(report.areAllPermissionsGranted()).thenReturn(false); - KujakuMultiplePermissionListener listener = new KujakuMultiplePermissionListener(mockContext); - listener.onPermissionsChecked(report); - - boolean result = report.isAnyPermissionPermanentlyDenied(); - - // Use the result in your assertions or further logic - assertFalse(result); - } -}