Skip to content

Commit

Permalink
[#354] Capitalize first word in test case name
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo committed Feb 8, 2023
1 parent 576ca89 commit 5f3f9c0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ class HomeScreenTest {
}

@Test
fun when_entering_the_Home_screen__it_shows_UI_correctly() = initComposable {
fun When_entering_the_Home_screen__it_shows_UI_correctly() = initComposable {
onNodeWithText("Home").assertIsDisplayed()
}

@Test
fun when_loading_list_item_successfully__it_shows_the_list_item_correctly() = initComposable {
fun When_loading_list_item_successfully__it_shows_the_list_item_correctly() = initComposable {
onNodeWithText("1").assertIsDisplayed()
onNodeWithText("2").assertIsDisplayed()
onNodeWithText("3").assertIsDisplayed()
}

@Test
fun when_clicking_on_a_list_item__it_navigates_to_Second_screen() = initComposable {
fun When_clicking_on_a_list_item__it_navigates_to_Second_screen() = initComposable {
onNodeWithText("1").performClick()

assertEquals(expectedAppDestination, AppDestination.Second)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ class HomeScreenTest {
}

@Test
fun `when entering the Home screen, it shows UI correctly`() = initComposable {
fun `When entering the Home screen, it shows UI correctly`() = initComposable {
onNodeWithText("Home").assertIsDisplayed()
}

@Test
fun `when loading list item successfully, it shows the list item correctly`() = initComposable {
fun `When loading list item successfully, it shows the list item correctly`() = initComposable {
onNodeWithText("1").assertIsDisplayed()
onNodeWithText("2").assertIsDisplayed()
onNodeWithText("3").assertIsDisplayed()
}

@Test
fun `when clicking on a list item, it navigates to Second screen`() = initComposable {
fun `When clicking on a list item, it navigates to Second screen`() = initComposable {
onNodeWithText("1").performClick()

assertEquals(expectedAppDestination, AppDestination.Second)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class HomeViewModelTest {
}

@Test
fun `when loading models successfully, it shows the model list`() = runTest {
fun `When loading models successfully, it shows the model list`() = runTest {
viewModel.uiModels.test {
expectMostRecentItem() shouldBe models.map { it.toUiModel() }
}
}

@Test
fun `when loading models failed, it shows the corresponding error`() = runTest {
fun `When loading models failed, it shows the corresponding error`() = runTest {
val error = Exception()
every { mockUseCase() } returns flow { throw error }
initViewModel(dispatchers = CoroutineTestRule(StandardTestDispatcher()).testDispatcherProvider)
Expand All @@ -67,7 +67,7 @@ class HomeViewModelTest {
}

@Test
fun `when calling navigate to Second, it navigates to Second screen`() = runTest {
fun `When calling navigate to Second, it navigates to Second screen`() = runTest {
viewModel.navigator.test {
viewModel.navigateToSecond(models[0].toUiModel())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HomeScreenTest {
}

@Test
fun when_entering_the_Home_screen__it_shows_UI_correctly() {
fun When_entering_the_Home_screen__it_shows_UI_correctly() {
composeRule.run {
onNodeWithText(activity.getString(R.string.app_name)).assertIsDisplayed()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class HomeViewModelTest {
}

@Test
fun `when loading models successfully, it shows the model list`() = runTest {
fun `When loading models successfully, it shows the model list`() = runTest {
viewModel.uiModels.test {
expectMostRecentItem() shouldBe models.map { it.toUiModel() }
}
}

@Test
fun `when loading models failed, it shows the corresponding error`() = runTest {
fun `When loading models failed, it shows the corresponding error`() = runTest {
val error = Exception()
every { mockUseCase() } returns flow { throw error }
initViewModel(dispatchers = CoroutineTestRule(StandardTestDispatcher()).testDispatcherProvider)
Expand Down

0 comments on commit 5f3f9c0

Please sign in to comment.