diff --git a/domain/src/test/java/org/oppia/android/domain/classify/rules/fractioninput/FractionInputIsEquivalentToRuleClassifierProviderTest.kt b/domain/src/test/java/org/oppia/android/domain/classify/rules/fractioninput/FractionInputIsEquivalentToRuleClassifierProviderTest.kt index 6708650e2c6..e42eb9e7513 100644 --- a/domain/src/test/java/org/oppia/android/domain/classify/rules/fractioninput/FractionInputIsEquivalentToRuleClassifierProviderTest.kt +++ b/domain/src/test/java/org/oppia/android/domain/classify/rules/fractioninput/FractionInputIsEquivalentToRuleClassifierProviderTest.kt @@ -39,23 +39,23 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { numerator = 2, denominator = 8 ) - private val FRACTION_VALUE_TEST_1_OVER_5 = + private val FRACTION_VALUE_TEST_1_OVER_4 = InteractionObjectTestBuilder.createFraction( isNegative = false, numerator = 1, - denominator = 5 + denominator = 4 ) - private val FRACTION_VALUE_TEST_33_OVER_2 = + private val FRACTION_VALUE_TEST_1_OVER_5 = InteractionObjectTestBuilder.createFraction( isNegative = false, - numerator = 33, - denominator = 2 + numerator = 1, + denominator = 5 ) - private val FRACTION_VALUE_TEST_242_OVER_1 = + private val FRACTION_VALUE_TEST_13_OVER_2 = InteractionObjectTestBuilder.createFraction( isNegative = false, - numerator = 242, - denominator = 1 + numerator = 13, + denominator = 2 ) private val MIXED_NUMBER_VALUE_TEST_6_1_OVER_2 = InteractionObjectTestBuilder.createMixedNumber( @@ -71,7 +71,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { numerator = 1, denominator = 4 ) - private val NON_NEGATIVE_VALUE_TEST_679_2_OVER_3 = + private val NEGATIVE_VALUE_TEST_679_2_OVER_3 = InteractionObjectTestBuilder.createMixedNumber( isNegative = true, wholeNumber = 679, @@ -93,7 +93,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_wholeNumber123Answer_withWholeNumber123Input_bothValuesEquivalent() { + fun testEquivalence_wholeNumber123Answer_withWholeNumber123Input_bothValuesEquivalent() { val inputs = mapOf("f" to WHOLE_NUMBER_VALUE_TEST_123) val answer = WHOLE_NUMBER_VALUE_TEST_123 @@ -104,7 +104,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_wholeNumber123Answer_withWholeNumber254Input_bothValuesNotEquivalent() { + fun testEquivalence_wholeNumber123Answer_withWholeNumber254Input_bothValuesNotEquivalent() { val inputs = mapOf("f" to WHOLE_NUMBER_VALUE_TEST_254) val matches = @@ -117,7 +117,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_fraction2Over4Answer_withFraction2Over4Input_bothValuesEquivalent() { + fun testEquivalence_fraction2Over8Answer_withFraction2Over8Input_bothValuesEquivalent() { val inputs = mapOf("f" to FRACTION_VALUE_TEST_2_OVER_8) val matches = @@ -130,7 +130,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_fraction2Over4Answer_withFraction1Over5Input_bothValuesNotEquivalent() { + fun testEquivalence_fraction2Over8Answer_withFraction1Over5Input_bothValuesNotEquivalent() { val inputs = mapOf("f" to FRACTION_VALUE_TEST_1_OVER_5) val matches = @@ -143,12 +143,12 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_fraction2Over33Answer_withFaction1Over242Input_bothValuesEquivalent() { - val inputs = mapOf("f" to FRACTION_VALUE_TEST_33_OVER_2) + fun testEquivalence_fraction1Over4Answer_withFraction2Over8Input_bothValuesEquivalent() { + val inputs = mapOf("f" to FRACTION_VALUE_TEST_2_OVER_8) val matches = inputIsEquivalentToRuleClassifier.matches( - answer = FRACTION_VALUE_TEST_33_OVER_2, + answer = FRACTION_VALUE_TEST_1_OVER_4, inputs = inputs ) @@ -156,46 +156,46 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_fraction2Over33Answer_withFaction1Over242Input_bothValuesNotEquivalent() { - val input = mapOf("f" to FRACTION_VALUE_TEST_242_OVER_1) + fun testEquivalence_mixedNumber6And1Over2Answer_withMixedNumber6And1Over2Input_bothValuesMatch() { + val inputs = mapOf("f" to MIXED_NUMBER_VALUE_TEST_6_1_OVER_2) val matches = inputIsEquivalentToRuleClassifier.matches( - answer = FRACTION_VALUE_TEST_33_OVER_2, - inputs = input + answer = MIXED_NUMBER_VALUE_TEST_6_1_OVER_2, + inputs = inputs ) - assertThat(matches).isFalse() + assertThat(matches).isTrue() } @Test - fun testEquality_mixedNumber6And1Over2Answer_withMixedNumber6And1Over2Input_bothValuesMatch() { + fun testEquivalence_mixedNum55And1Over4Answer_withMixedNum6And1Over2Input_bothValuesDoNotMatch() { val inputs = mapOf("f" to MIXED_NUMBER_VALUE_TEST_6_1_OVER_2) val matches = inputIsEquivalentToRuleClassifier.matches( - answer = MIXED_NUMBER_VALUE_TEST_6_1_OVER_2, + answer = MIXED_NUMBER_VALUE_TEST_55_1_OVER_4, inputs = inputs ) - assertThat(matches).isTrue() + assertThat(matches).isFalse() } @Test - fun testEquality_mixedNumber55And1Over4Answer_withMixedNumber6And1Over2Input_bothValuesMatch() { + fun testEquivalence_mixedNum6And1Over2Answer_withFraction13Over2Input_bothValuesMatch() { val inputs = mapOf("f" to MIXED_NUMBER_VALUE_TEST_6_1_OVER_2) val matches = inputIsEquivalentToRuleClassifier.matches( - answer = MIXED_NUMBER_VALUE_TEST_55_1_OVER_4, + answer = FRACTION_VALUE_TEST_13_OVER_2, inputs = inputs ) - assertThat(matches).isFalse() + assertThat(matches).isTrue() } @Test - fun testEquality_wholeNumberAnswer_withMixedNumberInput_bothValuesDoNotMatch() { + fun testEquivalence_wholeNumberAnswer_withMixedNumberInput_bothValuesDoNotMatch() { val inputs = mapOf("f" to MIXED_NUMBER_VALUE_TEST_6_1_OVER_2) val matches = @@ -208,8 +208,8 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_negativeMixedNumberAnswer_withPositiveMixedNumberInput_bothValuesDoNotMatch() { - val inputs = mapOf("f" to NON_NEGATIVE_VALUE_TEST_679_2_OVER_3) + fun testEquivalence_negativeMixedNumberAnswer_withPositiveMixedNumberInput_valuesDoNotMatch() { + val inputs = mapOf("f" to NEGATIVE_VALUE_TEST_679_2_OVER_3) val matches = inputIsEquivalentToRuleClassifier.matches( @@ -221,7 +221,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEqualityOf_mixedNumberAnswer_withFractionInput_bothValuesDoNotMatch() { + fun testEquivalenceOf_mixedNumberAnswer_withFractionInput_bothValuesDoNotMatch() { val inputs = mapOf("f" to FRACTION_VALUE_TEST_1_OVER_5) val matches = @@ -234,7 +234,7 @@ class FractionInputIsEquivalentToRuleClassifierProviderTest { } @Test - fun testEquality_missingInput_throwsException() { + fun testEquivalence_missingInput_throwsException() { val inputs = mapOf("y" to FRACTION_VALUE_TEST_2_OVER_8) val exception = assertThrows(IllegalStateException::class) {