Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1898: add unit tests for FractionInputIsExactlyEqualToRuleClassifierProvider #1924

Merged

Conversation

TheRealJessicaLi
Copy link
Contributor

@rt4914 PTAL

Explanation

Fixed #1898 by adding testing for FractionInputIsExactlyEqualToRuleClassifierProvider which was copied from the Oppia web repo.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@oppiabot
Copy link

oppiabot bot commented Oct 1, 2020

Hi! @TheRealJessicaLi, Welcome to Oppia! Please could you follow the instructions here to get started? You'll need to do this before we can accept your PR. I am closing this PR for now. Feel free to re-open it once you are done with the above instructions. Thanks!

@oppiabot oppiabot bot closed this Oct 1, 2020
@BenHenning
Copy link
Member

Looks like when you filled out the form, there was an extra space before your name which caused Oppiabot to get confused @TheRealJessicaLi :). It shouldn't auto-close this time.

@BenHenning
Copy link
Member

@TheRealJessicaLi it looks like you have lint failures. Please look at https://github.com/oppia/oppia-android/wiki/Ktlint-Guide for how to setup & run ktlint locally.

@TheRealJessicaLi
Copy link
Contributor Author

@TheRealJessicaLi it looks like you have lint failures. Please look at https://github.com/oppia/oppia-android/wiki/Ktlint-Guide for how to setup & run ktlint locally.

Fixed, thanks!

@anandwana001
Copy link
Contributor

Thought to mention here, we also need to remove the TODO comment from it's respective FractionInputIsExactlyEqualToRuleClassifierProvider file.

@TheRealJessicaLi TheRealJessicaLi force-pushed the fraction-input-exactly-equal-test branch from 74d87c8 to 06d429c Compare October 2, 2020 00:09
@TheRealJessicaLi
Copy link
Contributor Author

Thought to mention here, we also need to remove the TODO comment from it's respective FractionInputIsExactlyEqualToRuleClassifierProvider file.

Fixed, thanks!

Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TheRealJessicaLi! This looks really good! I honestly only have a few nits about styling & naming for the tests. Coverage wise this looks great!

}

// TODO(#89): Move to a common test library.
private fun <T : Throwable> assertThrows(type: KClass<T>, operation: () -> Unit): T {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rt4914 solving this might be a nice SLoP project idea if we split it up & update the TODOs (or just require that students search for them).

/cc @MohamedMedhat1998 @aggarwalpulkit596 @Sarthak2601

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MohamedMedhat1998 I don't think that's actually possible without something like Dagger Hilt which, as far as I'm aware, doesn't yet have full Gradle support. I was planning to adopt that once Bazel work is completed.

@BenHenning BenHenning removed their assignment Oct 2, 2020
@TheRealJessicaLi
Copy link
Contributor Author

Thanks @TheRealJessicaLi! This looks really good! I honestly only have a few nits about styling & naming for the tests. Coverage wise this looks great!

Thanks for the tips, just refactored everything to name things more explicitly

fixed lint issues
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent, thanks @TheRealJessicaLi! I have no further comments. :) Going ahead and merging this.

@BenHenning BenHenning merged commit 5fcb647 into oppia:develop Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thoroughly test FractionInputIsExactlyEqualToRuleClassifier
5 participants