Skip to content

Commit

Permalink
Fixes oppia#4098: Added tests for ComparableOperationSubjectTest (opp…
Browse files Browse the repository at this point in the history
…ia#5673)

Fixes oppia#4098:
This pull request includes changes to add tests for the
`ComparableOperationSubject` class and update the build configuration to
include these tests. The most important changes are:

### Test Additions:

* Added tests for `ComparableOperationSubject`

### Build Configuration:

* Added a new `oppia_android_test` target for
`ComparableOperationSubjectTest` in the `BUILD.bazel` file to include
the necessary dependencies and configuration for running the tests.
#### Screenshot of the passing tests.

![image](https://github.com/user-attachments/assets/138a2460-12ff-46d2-8d34-3e503960a381)

## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

---------

Co-authored-by: theayushyadav11 <your.email@example.com>
  • Loading branch information
theayushyadav11 and theayushyadav11 authored Mar 4, 2025
1 parent 469fe9c commit 45257da
Show file tree
Hide file tree
Showing 4 changed files with 447 additions and 6 deletions.
4 changes: 0 additions & 4 deletions scripts/assets/test_file_exemptions.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -4098,10 +4098,6 @@ test_file_exemption {
exempted_file_path: "testing/src/main/java/org/oppia/android/testing/logging/SyncStatusTestModule.kt"
override_min_coverage_percent_required: 0
}
test_file_exemption {
exempted_file_path: "testing/src/main/java/org/oppia/android/testing/math/ComparableOperationSubject.kt"
test_file_not_required: true
}
test_file_exemption {
exempted_file_path: "testing/src/main/java/org/oppia/android/testing/mockito/MockitoKotlinHelper.kt"
test_file_not_required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import org.oppia.android.app.model.ComparableOperation.ComparisonTypeCase
import org.oppia.android.app.model.Real
import org.oppia.android.testing.math.RealSubject.Companion.assertThat

// TODO(#4098): Add tests for this class.

/**
* Truth subject for verifying properties of [ComparableOperation]s.
*
Expand Down
16 changes: 16 additions & 0 deletions testing/src/test/java/org/oppia/android/testing/math/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,19 @@ oppia_android_test(
"//third_party:robolectric_android-all",
],
)

oppia_android_test(
name = "ComparableOperationSubjectTest",
srcs = ["ComparableOperationSubjectTest.kt"],
custom_package = "org.oppia.android.testing.math",
test_class = "org.oppia.android.testing.math.ComparableOperationSubjectTest",
test_manifest = "//testing:test_manifest",
deps = [
"//model/src/main/proto:math_java_proto_lite",
"//testing/src/main/java/org/oppia/android/testing/math:comparable_operation_subject",
"//testing/src/main/java/org/oppia/android/testing/robolectric:test_module",
"//third_party:com_google_truth_truth",
"//third_party:junit_junit",
"//third_party:robolectric_android-all",
],
)
Loading

0 comments on commit 45257da

Please sign in to comment.