https://play.google.com/store/apps/details?id=ai.susi https://github.com/fossasia/susi_android
dependabot-preview[bot] on gradle
dependabot-preview[bot] on gradle
chore(deps): bump gradle from 3… (compare)
dependabot-preview[bot] on gradle
dependabot-preview[bot] on gradle
chore(deps): bump com.diffplug.… (compare)
dependabot-preview[bot] on gradle
I am trying to write unit test for UtilModel
private lateinit var UtilModel: UtilModel
private lateinit var IUtilModel:IUtilModel
private lateinit var context: Context
@Before
fun setup() {
sharedPrefs = Mockito.mock(SharedPreferences::class.java)
context=Mockito.mock(Context::class.java)
UtilModel = UtilModel(context)
}
@Test
fun saveAnomityTest() {
IUtilModel=UtilModel.iUtilModel
`when`(IUtilModel.getAnonymity()).thenReturn(false)
assertEquals(false,IUtilModel.getAnonymity())
}
this isn't working... because ultimately getDefaultSharedPrefrence is not working with mock context
so question is how to getDefaultSharedPrefrences in tests??