Google is committed to advancing racial equity for Black communities. See how.

LocationSubject

public class LocationSubject
extends Subject

java.lang.Object
   ↳ com.google.common.truth.Subject
     ↳ androidx.test.ext.truth.location.LocationSubject


Subject for making assertions about Locations.

Summary

Public methods

static LocationSubject assertThat(Location location)
final BundleSubject extras()
void hasAccuracy()
void hasAltitude()
void hasBearing()
void hasSpeed()
void isAt(Location other)

Verifies that the location is centered on the same latitude/longitude as another location.

void isEqualTo(Object otherObj)
void isFaraway(Location other, float distanceM)

Verifies that the location is at least distanceM meters away from another location.

void isMock()
void isNearby(Location other, float distanceM)

Verifies that the location is at most distanceM meters away from another location.

void isNotMock()
static Factory<LocationSubjectLocation> locations()

Inherited methods

From class com.google.common.truth.Subject
From class java.lang.Object

Public methods

assertThat

LocationSubject assertThat (Location location)

Parameters
location Location

Returns
LocationSubject

extras

BundleSubject extras ()

Returns
BundleSubject

hasAccuracy

void hasAccuracy ()

hasAltitude

void hasAltitude ()

hasBearing

void hasBearing ()

hasSpeed

void hasSpeed ()

isAt

void isAt (Location other)

Verifies that the location is centered on the same latitude/longitude as another location.

Parameters
other Location

isEqualTo

void isEqualTo (Object otherObj)

Parameters
otherObj Object

isFaraway

void isFaraway (Location other, 
                float distanceM)

Verifies that the location is at least distanceM meters away from another location.

Parameters
other Location

distanceM float

isMock

void isMock ()

isNearby

void isNearby (Location other, 
                float distanceM)

Verifies that the location is at most distanceM meters away from another location.

Parameters
other Location

distanceM float

isNotMock

void isNotMock ()

locations

Factory<LocationSubjectLocation> locations ()

Returns
Factory<LocationSubjectLocation>