-
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.
- Loading branch information
Showing
3 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
...c/androidTest/java/ua/zt/mezon/graphomania/fsmandstrategydemo/ui/main/MainFragmentTest.kt
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
app/src/test/java/ua/zt/mezon/graphomania/fsmandstrategydemo/ui/main/MainFragmentTest.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,43 @@ | ||
package ua.zt.mezon.graphomania.fsmandstrategydemo.ui.main | ||
|
||
import com.nhaarman.mockitokotlin2.any | ||
import com.nhaarman.mockitokotlin2.never | ||
import com.nhaarman.mockitokotlin2.verify | ||
import junit.framework.TestCase | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.mockito.Spy | ||
import org.mockito.junit.MockitoJUnitRunner | ||
|
||
@RunWith(MockitoJUnitRunner::class) | ||
class MainFragmentTest : TestCase() { | ||
@Spy | ||
private lateinit var contract: MockForTestMainFragmentViewStatesRenderContract | ||
|
||
@Test | ||
fun testRenderInitState() { | ||
// Setup | ||
|
||
// Act | ||
contract.render(MainFragmentUiStatesModel.IniState) | ||
|
||
// Assert | ||
verify(contract).showIni() | ||
verify(contract, never()).showLoadCounterPercentData(any()) | ||
verify(contract, never()).showLoadError(any()) | ||
verify(contract, never()).showListEmpty() | ||
verify(contract, never()).showListShow(any()) | ||
} | ||
|
||
fun testRender() {} | ||
|
||
fun testShowInitState() {} | ||
|
||
fun testShowLoadProgress() {} | ||
|
||
fun testShowError() {} | ||
|
||
fun testShowEmptyState() {} | ||
|
||
fun testShowList() {} | ||
} |
20 changes: 20 additions & 0 deletions
20
...graphomania/fsmandstrategydemo/ui/main/MockForTestMainFragmentViewStatesRenderContract.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,20 @@ | ||
package ua.zt.mezon.graphomania.fsmandstrategydemo.ui.main | ||
|
||
import ua.zt.mezon.graphomania.fsmandstrategydemo.datasources.ItemData | ||
|
||
open class MockForTestMainFragmentViewStatesRenderContract : MainFragmentViewStatesRenderContract { | ||
override fun showIni() { | ||
} | ||
|
||
override fun showLoadCounterPercentData(percent: Int) { | ||
} | ||
|
||
override fun showLoadError(error: String?) { | ||
} | ||
|
||
override fun showListEmpty() { | ||
} | ||
|
||
override fun showListShow(listItems: ArrayList<ItemData>) { | ||
} | ||
} |