mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	refactor gallery picker test
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
		
							parent
							
								
									2739fccec4
								
							
						
					
					
						commit
						68e36864d0
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -64,13 +64,18 @@ class FilePickerTest { | |||
|         `when`(PreferenceManager.getDefaultSharedPreferences(activity)).thenReturn(sharedPref) | ||||
|         `when`(sharedPref.edit()).thenReturn(sharedPreferencesEditor) | ||||
|         `when`(sharedPref.edit().putInt("type", 0)).thenReturn(sharedPreferencesEditor) | ||||
|         FilePicker.openGallery(activity, 0, nextBoolean()) | ||||
|         val openDocumentPreferred = nextBoolean() | ||||
|         FilePicker.openGallery(activity, 0, openDocumentPreferred) | ||||
|         verify(activity).startActivityForResult( | ||||
|             ArgumentMatchers.any(), | ||||
|             requestCodeCaptor?.capture()?.toInt()!!, | ||||
|         ) | ||||
|         if(openDocumentPreferred){ | ||||
|             assertEquals(requestCodeCaptor?.value, RequestCodes.PICK_PICTURE_FROM_DOCUMENTS) | ||||
|         }else{ | ||||
|             assertEquals(requestCodeCaptor?.value, RequestCodes.PICK_PICTURE_FROM_GALLERY) | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
|     fun testOpenCameraForImageCode() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 parneet-guraya
						parneet-guraya