Skip to content

Commit

Permalink
Fixed tests, updated some dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
glodanif committed May 9, 2019
1 parent 20569dc commit 71c569b
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 28 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def final VERSION_CODE = 36
def final VERSION_NAME = '1.4'
def final VERSION_NAME = '1.3.2'

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
Expand Down Expand Up @@ -89,15 +89,15 @@ dependencies {

def final ROOM_VERSION = '2.0.0'
def final LIFECYCLE_VERSION = '2.0.0'
def final ESPRESSO_VERSION = '3.1.0-alpha4'
def final ESPRESSO_VERSION = '3.2.0-beta01'
def final COROUTINES_VERSION = '1.2.1'

implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'com.google.android.material:material:1.0.0'

implementation "androidx.room:room-runtime:$ROOM_VERSION"
Expand Down Expand Up @@ -129,7 +129,7 @@ dependencies {

testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$KOTLIN_VERSION"
testImplementation 'io.mockk:mockk:1.9.3.kotlin12'
testImplementation 'io.mockk:mockk:1.9.3'
testImplementation 'junit:junit:4.12'

androidTestImplementation 'androidx.annotation:annotation:1.0.2'
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/values-notnight/colors.xml

This file was deleted.

3 changes: 0 additions & 3 deletions app/src/main/res/values-notnight/styles.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.glodanif.bluetoothchat.ui.viewmodel.converter.ChatMessageConverter
import io.mockk.MockKAnnotations
import io.mockk.impl.annotations.RelaxedMockK
import io.mockk.verify
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.glodanif.bluetoothchat.ui.viewmodel.ContactViewModel
import com.glodanif.bluetoothchat.ui.viewmodel.converter.ContactConverter
import io.mockk.*
import io.mockk.impl.annotations.RelaxedMockK
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import com.glodanif.bluetoothchat.ui.viewmodel.ConversationViewModel
import com.glodanif.bluetoothchat.ui.viewmodel.converter.ConversationConverter
import io.mockk.*
import io.mockk.impl.annotations.RelaxedMockK
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.experimental.runBlocking
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import org.junit.Before
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.RelaxedMockK
import io.mockk.verify
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.RelaxedMockK
import io.mockk.verify
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.coEvery
import io.mockk.impl.annotations.RelaxedMockK
import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.glodanif.bluetoothchat.ui.presenter.ScanPresenter
import com.glodanif.bluetoothchat.ui.view.ScanView
import io.mockk.*
import io.mockk.impl.annotations.RelaxedMockK
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package com.glodanif.bluetoothchat.presenter
import android.graphics.Color
import com.glodanif.bluetoothchat.data.model.UserPreferences
import com.glodanif.bluetoothchat.ui.presenter.SettingsPresenter
import com.glodanif.bluetoothchat.ui.util.ThemeHolder
import com.glodanif.bluetoothchat.ui.view.SettingsView
import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.RelaxedMockK
import io.mockk.verify
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.Dispatchers
import org.junit.Before
import org.junit.Test

Expand All @@ -18,13 +19,16 @@ class SettingsPresenterUnitTest {
private lateinit var view: SettingsView
@RelaxedMockK
private lateinit var preferences: UserPreferences
@RelaxedMockK
private lateinit var themeHolder: ThemeHolder

private lateinit var presenter: SettingsPresenter

@Before
fun setup() {
MockKAnnotations.init(this)
presenter = SettingsPresenter(view, preferences, Dispatchers.Unconfined, Dispatchers.Unconfined)
presenter = SettingsPresenter(view, preferences, themeHolder,
Dispatchers.Unconfined, Dispatchers.Unconfined)
}

@Test
Expand All @@ -35,7 +39,7 @@ class SettingsPresenterUnitTest {
presenter.loadPreferences()
verify { view.displayNotificationSetting(true) }
verify { view.displayDiscoverySetting(true) }
verify { view.displayAppearanceSettings(Color.GREEN) }
verify { view.displayBgColorSettings(Color.GREEN) }
}

@Test
Expand All @@ -48,6 +52,6 @@ class SettingsPresenterUnitTest {
@Test
fun newColor() {
presenter.onNewColorPicked(Color.GREEN)
verify { view.displayAppearanceSettings(Color.GREEN) }
verify { view.displayColorPicker(Color.GREEN) }
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Apr 20 10:03:03 EEST 2019
#Thu May 09 00:18:11 EEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-rc-1-all.zip

0 comments on commit 71c569b

Please sign in to comment.