.subscribeOn變換上面function的執行序(只能改一次)(往下遞延)

JBLin 發表在 痞客邦 留言(0) 人氣()

https://projectlombok.org/features/all


JBLin 發表在 痞客邦 留言(0) 人氣()

使用CountDownLatch來做等待的動作
執行CountDownLatch.await()會讓執行序停止

JBLin 發表在 痞客邦 留言(0) 人氣()

1.gradle新增clearData的task

image

文章標籤

JBLin 發表在 痞客邦 留言(0) 人氣()

當用到enbase64 class做單元測試時,要使用androidTest


JBLin 發表在 痞客邦 留言(0) 人氣()

1.gradle 新增依賴

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.0.2'
androidTestImplementation 'androidx.test:rules:1.2.0'

2.取得context

JBLin 發表在 痞客邦 留言(0) 人氣()

1.gradle加入junit依賴

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
android {
    defaultConfig {
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
}

2.單元測試代碼

JBLin 發表在 痞客邦 留言(0) 人氣()

目的:將物件統合在一個容器內做管理

JBLin 發表在 痞客邦 留言(0) 人氣()

1.gradle依賴

//dagger
implementation 'com.google.dagger:dagger:2.24'
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
implementation 'com.google.dagger:dagger-android:2.24'
implementation 'com.google.dagger:dagger-android-support:2.24'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.24'

2.將component注入在application

JBLin 發表在 痞客邦 留言(0) 人氣()

gradle新增依賴

implementation "io.reactivex.rxjava2:rxjava:2.1.7"
implementation "io.reactivex.rxjava2:rxandroid:2.0.1"

 

JBLin 發表在 痞客邦 留言(0) 人氣()