mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	refactor: rename containsYear to isSpammyCategory (take 2)
A continuation of fe74c77ab (refactor: rename containsYear
 to isSpammyCategory, 2024-07-17)
			
			
This commit is contained in:
		
							parent
							
								
									fe74c77abf
								
							
						
					
					
						commit
						61445e36b9
					
				
					 4 changed files with 6 additions and 7 deletions
				
			
		|  | @ -148,7 +148,7 @@ public class UploadRepository { | |||
|      * @param name | ||||
|      * @return | ||||
|      */ | ||||
|     public boolean containsYear(String name) { | ||||
|     public boolean isSpammyCategory(String name) { | ||||
|         return categoriesModel.isSpammyCategory(name); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -89,7 +89,7 @@ class CategoriesPresenter @Inject constructor( | |||
|         if (media == null) { | ||||
|             return repository.searchAll(term, getImageTitleList(), repository.selectedDepictions) | ||||
|                 .subscribeOn(ioScheduler) | ||||
|                 .map { it.filter { categoryItem -> !repository.containsYear(categoryItem.name) | ||||
|                 .map { it.filter { categoryItem -> !repository.isSpammyCategory(categoryItem.name) | ||||
|                         || categoryItem.name==term } } | ||||
|         } else { | ||||
|             return Observable.zip( | ||||
|  | @ -103,7 +103,7 @@ class CategoriesPresenter @Inject constructor( | |||
|                 it1 + it2 | ||||
|             } | ||||
|                 .subscribeOn(ioScheduler) | ||||
|                 .map { it.filter { categoryItem -> !repository.containsYear(categoryItem.name) | ||||
|                 .map { it.filter { categoryItem -> !repository.isSpammyCategory(categoryItem.name) | ||||
|                         || categoryItem.name==term } } | ||||
|                 .map { it.filterNot { categoryItem -> categoryItem.thumbnail == "hidden" } } | ||||
|         } | ||||
|  |  | |||
|  | @ -14,7 +14,6 @@ import media | |||
| import org.junit.Before | ||||
| import org.junit.Test | ||||
| import org.mockito.Mock | ||||
| import org.mockito.Mockito.verifyNoInteractions | ||||
| import org.mockito.MockitoAnnotations | ||||
| import java.lang.reflect.Method | ||||
| 
 | ||||
|  | @ -97,8 +96,8 @@ class CategoriesPresenterTest { | |||
|                     ) | ||||
|                 ) | ||||
|             ) | ||||
|         whenever(repository.containsYear("selected")).thenReturn(false) | ||||
|         whenever(repository.containsYear("doesContainYear")).thenReturn(true) | ||||
|         whenever(repository.isSpammyCategory("selected")).thenReturn(false) | ||||
|         whenever(repository.isSpammyCategory("doesContainYear")).thenReturn(true) | ||||
|         whenever(repository.selectedCategories).thenReturn(listOf( | ||||
|             categoryItem("selected", "", "",true))) | ||||
|         categoriesPresenter.searchForCategories("test") | ||||
|  |  | |||
|  | @ -156,7 +156,7 @@ class UploadRepositoryUnitTest { | |||
|     @Test | ||||
|     fun testContainsYear() { | ||||
|         assertEquals( | ||||
|             repository.containsYear(""), categoriesModel.isSpammyCategory("") | ||||
|             repository.isSpammyCategory(""), categoriesModel.isSpammyCategory("") | ||||
|         ) | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kaartic Sivaraam
						Kaartic Sivaraam