Skip to content

Commit

Permalink
Rename tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maimoonak committed Sep 2, 2022
1 parent 77b163e commit b9f40b6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class QuestionnaireItemEditTextQuantityViewHolderFactoryEspressoTest {
}

@Test
fun getValue_WithInitial_shouldReturnQuantityWithUnitAndSystem() {
fun getValue_WithInitial_shouldReturn_Quantity_With_UnitAndSystem() {
val questionnaireItemViewItem =
QuestionnaireItemViewItem(
Questionnaire.QuestionnaireItemComponent().apply {
Expand Down Expand Up @@ -88,7 +88,7 @@ class QuestionnaireItemEditTextQuantityViewHolderFactoryEspressoTest {
}

@Test
fun getValue_WithoutInitial_shouldReturnQuantityWithoutUnitAndSystem() {
fun getValue_WithoutInitial_shouldReturn_Quantity_Without_UnitAndSystem() {
val questionnaireItemViewItem =
QuestionnaireItemViewItem(
Questionnaire.QuestionnaireItemComponent().apply { required = true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.recyclerview.widget.RecyclerView
import com.google.android.fhir.datacapture.validation.ValidationResult
import com.google.common.annotations.VisibleForTesting

/**
* Factory for [QuestionnaireItemViewHolder].
Expand Down Expand Up @@ -51,7 +50,6 @@ abstract class QuestionnaireItemViewHolderFactory(@LayoutRes open val resId: Int
*/
open class QuestionnaireItemViewHolder(
itemView: View,
@org.jetbrains.annotations.VisibleForTesting
private val delegate: QuestionnaireItemViewHolderDelegate
) : RecyclerView.ViewHolder(itemView) {
init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ class MoreQuestionnaireItemComponentsTest {
}

@Test
fun calculatedExpression_shouldReturnExpression() {
fun `calculatedExpression should return expression for valid extension url`() {
val questionnaire =
Questionnaire.QuestionnaireItemComponent().apply {
addExtension(
Expand All @@ -724,7 +724,7 @@ class MoreQuestionnaireItemComponentsTest {
}

@Test
fun calculatedExpression_shouldReturnNull() {
fun `calculatedExpression should return null for other extension url`() {
val questionnaire =
Questionnaire.QuestionnaireItemComponent().apply {
addExtension(
Expand Down Expand Up @@ -933,7 +933,7 @@ class MoreQuestionnaireItemComponentsTest {
}

@Test
fun createQuestionResponseWithQuantityType_ShouldNotSetAnswer_WithValueEmpty() {
fun `createQuestionResponse should not set answer for quantity type with missing value `() {
val question =
Questionnaire.QuestionnaireItemComponent(
StringType("age"),
Expand All @@ -960,7 +960,7 @@ class MoreQuestionnaireItemComponentsTest {
}

@Test
fun createQuestionResponseWithQuantityType_ShouldSetAnswer() {
fun `createQuestionResponse should set answer with quantity type`() {
val question =
Questionnaire.QuestionnaireItemComponent(
StringType("age"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.robolectric.annotation.Config
class QuestionnaireFragmentTest {

@Test
fun testFragment_ShouldBeAbleToBuildQuestionnaireResponse() {
fun `fragment should have valid questionnaire response`() {
val questionnaire =
Questionnaire().apply {
id = "a-questionnaire"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2713,7 +2713,8 @@ class QuestionnaireViewModelTest(
}

@Test
fun questionnaireItem_calculatedExpressionExtension_shouldCalculateValue_onStart() = runBlocking {
fun `should calculate value on start for questionnaire item with calculated expression extension`() =
runBlocking {
val questionnaire =
Questionnaire().apply {
id = "a-questionnaire"
Expand Down Expand Up @@ -2771,7 +2772,7 @@ class QuestionnaireViewModelTest(
}

@Test
fun questionnaireItem_calculatedExpressionExtension_shouldCalculateValue_onChange() =
fun `should calculate value on change for questionnaire item with calculated expression extension`() =
runBlocking {
val questionnaire =
Questionnaire().apply {
Expand Down Expand Up @@ -2833,7 +2834,7 @@ class QuestionnaireViewModelTest(
}

@Test
fun questionnaireItem_calculatedExpressionExtensionInFlatList_shouldDetectCyclicDependency() =
fun `should detect cyclic dependency for questionnaire item with calculated expression extension in flat list`() =
runBlocking {
val questionnaire =
Questionnaire().apply {
Expand Down Expand Up @@ -2887,7 +2888,7 @@ class QuestionnaireViewModelTest(
}

@Test
fun questionnaireItem_calculatedExpressionExtensionInNestedItems_shouldDetectCyclicDependency() =
fun `should detect cyclic dependency for questionnaire item with calculated expression extension in nested list`() =
runBlocking {
val questionnaire =
Questionnaire().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class QuestionnaireItemDatePickerViewHolderFactoryTest {
}

@Test
fun shouldSetEmptyDateInput_WhenDateFieldInitialized_AndDateIsNull() {
fun `should set text field empty when date field is initialized but answer date value is null`() {
viewHolder.bind(
QuestionnaireItemViewItem(
Questionnaire.QuestionnaireItemComponent().apply { text = "Question?" },
Expand Down

0 comments on commit b9f40b6

Please sign in to comment.