-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from omer358/dev
Impl Person Details and navigation to and from PeopleList Screen
- Loading branch information
Showing
31 changed files
with
941 additions
and
157 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
app/src/androidTest/java/com/example/rememberme/data/repository/PeopleRepositoryImplTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
//package com.example.rememberme.data.repository | ||
// | ||
//import com.example.rememberme.R | ||
//import com.example.rememberme.data.PeopleRepositoryImpl | ||
//import com.example.rememberme.domain.model.People | ||
//import com.example.remindme.database.PeopleDao | ||
//import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
//import kotlinx.coroutines.test.runTest | ||
//import org.junit.Assert.assertEquals | ||
//import org.junit.Before | ||
//import org.junit.Test | ||
//import org.mockito.MockitoAnnotations | ||
//import javax.inject.Inject | ||
// | ||
//@ExperimentalCoroutinesApi | ||
//class PeopleRepositoryImplTest { | ||
// | ||
// @Inject | ||
// private lateinit var peopleDao: PeopleDao | ||
// | ||
// private lateinit var peopleRepository: PeopleRepositoryImpl | ||
// | ||
// @Before | ||
// fun setUp() { | ||
// MockitoAnnotations.initMocks(this::class) | ||
// peopleRepository = PeopleRepositoryImpl(peopleDao) | ||
// } | ||
// | ||
// @Test | ||
// fun getAllPeopleShouldReturnListOfPeople() = runTest { | ||
// // Arrange | ||
// val peopleList = listOf( | ||
// People( | ||
// 1, "John", secondName = "Doe", place = "", time = "", gender = "",avatar= R.drawable.ic_m3,), | ||
// People(1, "John", secondName = "Doe", place = "", time = "", gender = "",avatar= R.drawable.ic_m3,) | ||
// ) | ||
// peopleRepository.insertPeople(peopleList[0]) | ||
// peopleRepository.insertPeople(peopleList[1]) | ||
// | ||
// // Act | ||
// val result = peopleRepository.getAllPeople() | ||
// | ||
// // Assert | ||
// result.collect { | ||
// assertEquals(peopleList, it) | ||
// } | ||
// } | ||
// | ||
//// @Test | ||
//// fun insertPeopleShouldCallInsertPeopleOnDao() = runBlocking { | ||
//// // Arrange | ||
//// val person = People(1, "John", secondName = "Doe", place = "", time = "", gender = "",avatar= R.drawable.ic_m3,) | ||
//// | ||
//// // Act | ||
//// peopleRepository.insertPeople(person) | ||
//// | ||
//// // Assert | ||
//// Mockito.verify(peopleDao, Mockito.times(1)).insertPeople(person) | ||
//// } | ||
//// | ||
//// @Test | ||
//// fun `deletePeople should call deletePeople on dao`() = runBlocking { | ||
//// // Arrange | ||
//// val person = People(1, "John", secondName = "Doe", place = "", time = "", gender = "",avatar= R.drawable.ic_m3,) | ||
//// | ||
//// // Act | ||
//// peopleRepository.deletePeople(person) | ||
//// | ||
//// // Assert | ||
//// Mockito.verify(peopleDao, Mockito.times(1)).deletePeople(person) | ||
//// } | ||
//// | ||
//// @Test | ||
//// fun `updatePeople should call updatePeople on dao`() = runBlocking { | ||
//// // Arrange | ||
//// val person = People(1, "John Doe") | ||
//// | ||
//// // Act | ||
//// peopleRepository.updatePeople(person) | ||
//// | ||
//// // Assert | ||
//// Mockito.verify(peopleDao, Mockito.times(1)).updatePeople(person) | ||
//// } | ||
//// | ||
//// @Test | ||
//// fun `deleteAllPeople should call deleteAllPeople on dao`() = runBlocking { | ||
//// // Act | ||
//// peopleRepository.deleteAllPeople() | ||
//// | ||
//// // Assert | ||
//// Mockito.verify(peopleDao, Mockito.times(1)).deleteAllPeople() | ||
//// } | ||
//// | ||
//// @Test | ||
//// fun `getPeopleById should return person`() = runBlocking { | ||
//// // Arrange | ||
//// val person = People(1, "John Doe") | ||
//// Mockito.`when`(peopleDao.getPeopleById(1)).thenReturn(person) | ||
//// | ||
//// // Act | ||
//// val result = peopleRepository.getPeopleById(1) | ||
//// | ||
//// // Assert | ||
//// assertEquals(person, result) | ||
//// } | ||
//// | ||
//// @Test | ||
//// fun `getPeopleByName should return list of people`() = runBlocking { | ||
//// // Arrange | ||
//// val peopleList = listOf(People(1, "John Doe"), People(2, "John Smith")) | ||
//// Mockito.`when`(peopleDao.getPeopleByName("John")).thenReturn(peopleList) | ||
//// | ||
//// // Act | ||
//// val result = peopleRepository.getPeopleByName("John") | ||
//// | ||
//// // Assert | ||
//// assertEquals(peopleList, result) | ||
//// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/example/rememberme/RememberMeApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.example.rememberme | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class RememberMeApplication: Application() { | ||
} |
Oops, something went wrong.