dmytroKarataiev / EarthquakeSurvival

Earthquake tracking application (RxJava, SQLite, Content Provider, Sync Adapter).
MIT License
13 stars 1 forks source link

Comprehensive Unit Tests for LocationUtils #67

Open sweep-fundrise[bot] opened 4 hours ago

sweep-fundrise[bot] commented 4 hours ago

Purpose

This pull request adds comprehensive unit tests for the LocationUtils class in the EarthquakeSurvival app. The tests cover all the public methods in LocationUtils.java to ensure their correct behavior.

Description

The changes in this pull request include:

  1. Creating a new test file app/src/test/java/com/adkdevelopment/earthquakesurvival/utils/LocationUtilsTest.java to implement the unit tests.
  2. Implementing test methods for each public method in LocationUtils.java, including:
    • testGetErrorString
    • testGetTransitionString
    • testGetTransitionDetails
    • testGetLocation
    • testSetLocation
    • testSetLocationWithNullLocation
    • testGetDistance
    • testGetDistanceWithZeroLatitude
  3. Using Mockito to mock Android-specific classes like Context, SharedPreferences, and Geofence to allow for isolated testing of the utility methods.

Summary

The key changes in this pull request are:

Fixes

66. Continue the conversation here: http://localhost:3000/c/5a7192a6-a7a1-4502-b55e-d8c4ae602ed3.

To have Sweep make further changes, please add a comment to this PR starting with "Sweep:".

:book: For more information on how to use Sweep, please read our documentation.

Tracking ID: 0fdc4bf397
sweep-fundrise[bot] commented 4 hours ago

No CI failures were found. If you think this is an error, check Sweep's permissions at https://github.com/organizations/dmytroKarataiev/settings/installations/.