{"id":22188779,"url":"https://github.com/aliiiw/test-learning","last_synced_at":"2026-05-20T14:03:51.191Z","repository":{"id":251900063,"uuid":"838784129","full_name":"Aliiiw/Test-Learning","owner":"Aliiiw","description":"this is repo for flash back to testing :)","archived":false,"fork":false,"pushed_at":"2024-08-12T09:30:08.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T00:31:44.247Z","etag":null,"topics":["android","espresso","junit4","mockito","mockk-android","roboelectric","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aliiiw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-06T10:36:16.000Z","updated_at":"2024-10-05T11:14:56.000Z","dependencies_parsed_at":"2024-12-02T11:22:33.169Z","dependency_job_id":null,"html_url":"https://github.com/Aliiiw/Test-Learning","commit_stats":null,"previous_names":["aliiiw/test-learning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aliiiw%2FTest-Learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aliiiw%2FTest-Learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aliiiw%2FTest-Learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aliiiw%2FTest-Learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aliiiw","download_url":"https://codeload.github.com/Aliiiw/Test-Learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245344005,"owners_count":20599867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","espresso","junit4","mockito","mockk-android","roboelectric","unit-testing"],"created_at":"2024-12-02T11:12:29.497Z","updated_at":"2026-05-20T14:03:51.185Z","avatar_url":"https://github.com/Aliiiw.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test-Learning\n\nTest-Learning is an Android/Kotlin practice project focused on unit testing fundamentals. It contains small, testable classes for arithmetic, registration validation, string assertions, and repository/service interactions with mocks.\n\n## What This Project Covers\n\n- Basic JUnit tests.\n- Google Truth fluent assertions.\n- Mockito and Mockito-Kotlin mocks.\n- Testing simple business logic.\n- Testing validation rules.\n- Testing repository behavior against a mocked service.\n- Android project setup with ViewBinding enabled.\n\n## Tech Stack\n\n- Kotlin\n- Android XML/View system\n- AppCompat\n- ViewBinding\n- JUnit 4\n- Google Truth\n- Mockito Core\n- Mockito-Kotlin\n- Espresso / AndroidX test dependencies\n\n## Project Structure\n\n```text\napp/src/main/java/ir/alirahimi/testapp\n├── Calculator.kt                 # Simple arithmetic methods\n├── RegistrationUtil.kt           # Registration validation rules\n├── MainActivity.kt               # Minimal Android activity\n└── data\n    ├── local/User.kt             # User data model\n    ├── service/UserService.kt    # In-memory user source\n    └── repository/UserRepository.kt\n\napp/src/test/java/ir/alirahimi/testapp\n├── CalculatorTest.kt\n├── RegistrationUtilTest.kt\n├── StringTest.kt\n├── UserRepositoryTest.kt\n├── MainActivityTest.kt\n└── ExampleUnitTest.kt\n```\n\n## Tested Logic\n\n### Calculator\n\nThe calculator supports:\n\n- Addition\n- Subtraction\n- Multiplication\n- Integer division\n- Division-by-zero protection in production code\n\n### Registration Validation\n\n`RegistrationUtil` returns invalid when:\n\n- Username is empty.\n- Password is empty.\n- Username already exists.\n- Password confirmation does not match.\n- Password contains fewer than two digits.\n\n### Repository Tests\n\n`UserRepositoryTest` uses Mockito to mock `UserService` and verify that repository methods call the expected service methods for:\n\n- Get user by ID\n- Get user by name\n- Get user by email\n- Get all users\n- Invalid user lookup\n\n## Running Tests\n\n```bash\n./gradlew test\n```\n\nFor Android instrumentation tests:\n\n```bash\n./gradlew connectedAndroidTest\n```\n\n## Getting Started\n\n1. Clone the repository.\n2. Open it in Android Studio.\n3. Sync Gradle.\n4. Run the unit tests from Android Studio or with Gradle.\n\n## Notes\n\nThis repository is intentionally small and focused on testing practice, not on building a full user-facing Android app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliiiw%2Ftest-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliiiw%2Ftest-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliiiw%2Ftest-learning/lists"}