mirror of
https://github.com/imcarlost/Friendlists.git
synced 2026-04-10 02:46:54 -04:00
implement testing and create a simple test for Userlist
This commit is contained in:
@@ -52,12 +52,6 @@ dependencies {
|
||||
api deps.timber
|
||||
api deps.lottie
|
||||
api deps.picasso
|
||||
//Testing
|
||||
api deps.testing.junit
|
||||
api deps.testing.koin
|
||||
api deps.testing.core
|
||||
api deps.testing.rules
|
||||
api deps.testing.runner
|
||||
api deps.testing.ext
|
||||
api deps.testing.espresso
|
||||
testImplementation project(':testing')
|
||||
androidTestImplementation project(':testing')
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ interface AlbumDao {
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun saveAll(entities: List<AlbumEntity>)
|
||||
|
||||
@get:Query("SELECT * FROM ${AlbumEntity.TABLE_NAME}")
|
||||
val all: List<AlbumEntity>
|
||||
|
||||
@Query("SELECT * FROM ${AlbumEntity.TABLE_NAME} WHERE userId = :userId ORDER BY id ASC")
|
||||
fun getAlbums(userId: Int): List<AlbumEntity>
|
||||
|
||||
|
||||
@@ -15,9 +15,6 @@ interface PhotoDao {
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun saveAll(entities: List<PhotoEntity>)
|
||||
|
||||
@get:Query("SELECT * FROM ${PhotoEntity.TABLE_NAME}")
|
||||
val all: List<PhotoEntity>
|
||||
|
||||
@Query("SELECT * FROM ${PhotoEntity.TABLE_NAME} WHERE albumId = :albumId ORDER BY id ASC")
|
||||
fun getPhotos(albumId: Int): List<PhotoEntity>
|
||||
|
||||
|
||||
@@ -18,9 +18,6 @@ interface UserDao {
|
||||
@Query("UPDATE ${UserEntity.TABLE_NAME} SET isFavorite = :favorite WHERE id = :id")
|
||||
fun saveFavorite(id: Int, favorite: Boolean): Int
|
||||
|
||||
@get:Query("SELECT * FROM ${UserEntity.TABLE_NAME}")
|
||||
val all: List<UserEntity>
|
||||
|
||||
@Query("SELECT * FROM ${UserEntity.TABLE_NAME} ORDER BY id ASC")
|
||||
fun getAllUsers(): List<UserEntity>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ data class UserEntity(
|
||||
val email: String,
|
||||
val phone: String,
|
||||
val website: String,
|
||||
val isFavorite: Boolean = true
|
||||
val isFavorite: Boolean = false
|
||||
) {
|
||||
companion object {
|
||||
const val TABLE_NAME = "users"
|
||||
|
||||
Reference in New Issue
Block a user