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

unit test for optIn, multiOptIn, confirmation eligibility check implemented #15

Merged
merged 2 commits into from
Jun 2, 2022

Conversation

creative-dev-lab
Copy link
Contributor

@creative-dev-lab creative-dev-lab commented May 12, 2022

  • JSON Mapping data loading check
  • Eligibility checks for the OptIn widget with all possible conditions
  • Eligibility checks for the MultiOption with all possible conditions
  • Eligibility checks for the ConfirmationWidget

@creative-dev-lab creative-dev-lab changed the title unit test for optIn, multiOptIn, confirmation eligibility check imple… unit test for optIn, multiOptIn, confirmation eligibility check implemented May 12, 2022
@@ -0,0 +1,425 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mock json data added here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I don't know a typical android project structure, but I might have expected "mock" or something in the file path, but if you think this is ok, then cool 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added JSON as a mock data instead of adding a mock object in the specific file because this can simulate how we parse the JSON data from the api call.
And if we are going to create the mock object, it's going to be a very huge object and I cannot create it one by one.

}

@Test
fun testOptInEligibility() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

OptIn Eligibility check here 👇

}
}

private val optInInput = arrayListOf(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can add as many possible cases as we can here. 👇

)

@Test
fun testMultiOptInEligibility() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MultiOptIn eligibility check here

)

@Test
fun testConfirmationEligibility() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

confirmation widget eligibility check here

@creative-dev-lab creative-dev-lab merged commit bbfa694 into master Jun 2, 2022
@creative-dev-lab creative-dev-lab deleted the eli/unitTest branch June 2, 2022 19:36
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.

2 participants