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-tests #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

unit-tests #3

wants to merge 2 commits into from

Conversation

hifeful
Copy link
Owner

@hifeful hifeful commented Aug 19, 2023

  • unit tests for a MealManiaViewModel, MealDetailsViewState, and Reducer of the MealDetailsFeature were added

Copy link

@epam-alyse epam-alyse left a comment

Choose a reason for hiding this comment

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

WDYT are the task requirements exactly the way of TDD?

Copy link

@epam-alyse epam-alyse left a comment

Choose a reason for hiding this comment

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

Needs to demonstrate usage of Robolectric

- mocks instead of real objects are used in the MealDetailsViewStateTest now
- test titles in the MealManiaViewModelTest.kt were changed
- comments were removed
@hifeful
Copy link
Owner Author

hifeful commented Aug 21, 2023

WDYT are the task requirements exactly the way of TDD?

If we're talking about the strict TDD, then we should start writing our code from the unit tests.
So, we should write tests that don't compile regarding our business logic and then implement the actual code.
Unfortunately, I didn't work on projects like that and I'm not quite sure if it's really needed.

@hifeful
Copy link
Owner Author

hifeful commented Aug 21, 2023

Needs to demonstrate usage of Robolectric

Regarding the usage of Robolectic, in my unit tests, I added @RunWith annotation with the AndroidJUnit4 runner that makes available classes from the Android SDK. I needed Uri and Context classes, so Robolectric helped me.

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