Last active
July 3, 2023 20:44
-
-
Save Foxpace/9a4e26b5fff588c9b55d466cd1c8d360 to your computer and use it in GitHub Desktop.
Turbine example test
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
@RunWith(JUnit4::class) | |
class TurbineViewModelTest { | |
// 1. | |
@Mock | |
lateinit var heavyComputation: HeavyComputationTemplate | |
// 2. | |
@get:Rule | |
val mockitoRule: MockitoRule = MockitoJUnit.rule() | |
@Test | |
fun `Given the sut is initialized, then it waits for event`() { | |
// 3. | |
val sut = ExampleViewModel(heavyComputation) | |
// 4. | |
assertTrue(sut.vmState.value == VmState.Waiting) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment