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

FloatSubject accuracy()
DoubleSubject altitude()
static LocationSubject assertThat(Location location)
FloatSubject bearing()
FloatSubject bearingAccuracy()
FloatSubject bearingTo(double latitude, double longitude)
FloatSubject bearingTo(Location location)
FloatSubject distanceTo(double latitude, double longitude)
FloatSubject distanceTo(Location location)
void doesNotHaveProvider(String provider)
LongSubject elapsedRealtimeMillis()
LongSubject elapsedRealtimeNanos()
final BundleSubject extras()
void hasAccuracy()
void hasAltitude()
void hasBearing()
void hasBearingAccuracy()
void hasProvider(String provider)
void hasSpeed()
void hasSpeedAccuracy()
void hasVerticalAccuracy()
void isAt(double latitude, double longitude)
void isAt(Location other)

Verifies that the location is at 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 isNotAt(Location other)
void isNotAt(double latitude, double longitude)
void isNotMock()
static Factory<LocationSubjectLocation> locations()
FloatSubject speed()
FloatSubject speedAccuracy()
LongSubject time()
FloatSubject verticalAccuracy()

Inherited methods

Public methods

accuracy

public FloatSubject accuracy ()

Returns
FloatSubject

altitude

public DoubleSubject altitude ()

Returns
DoubleSubject

assertThat

public static LocationSubject assertThat (Location location)

Parameters
location Location

Returns
LocationSubject

bearing

public FloatSubject bearing ()

Returns
FloatSubject

bearingAccuracy

public FloatSubject bearingAccuracy ()

Returns
FloatSubject

bearingTo

public FloatSubject bearingTo (double latitude, 
                double longitude)

Parameters
latitude double

longitude double

Returns
FloatSubject

bearingTo

public FloatSubject bearingTo (Location location)

Parameters
location Location

Returns
FloatSubject

distanceTo

public FloatSubject distanceTo (double latitude, 
                double longitude)

Parameters
latitude double

longitude double

Returns
FloatSubject

distanceTo

public FloatSubject distanceTo (Location location)

Parameters
location Location

Returns
FloatSubject

doesNotHaveProvider

public void doesNotHaveProvider (String provider)

Parameters
provider String

elapsedRealtimeMillis

public LongSubject elapsedRealtimeMillis ()

Returns
LongSubject

elapsedRealtimeNanos

public LongSubject elapsedRealtimeNanos ()

Returns
LongSubject

extras

public final BundleSubject extras ()

Returns
BundleSubject

hasAccuracy

public void hasAccuracy ()

hasAltitude

public void hasAltitude ()

hasBearing

public void hasBearing ()

hasBearingAccuracy

public void hasBearingAccuracy ()

hasProvider

public void hasProvider (String provider)

Parameters
provider String

hasSpeed

public void hasSpeed ()

hasSpeedAccuracy

public void hasSpeedAccuracy ()

hasVerticalAccuracy

public void hasVerticalAccuracy ()

isAt

public void isAt (double latitude, 
                double longitude)

Parameters
latitude double

longitude double

isAt

public void isAt (Location other)

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

Parameters
other Location

isEqualTo

public void isEqualTo (Object otherObj)

Parameters
otherObj Object

isFaraway

public 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

public void isMock ()

isNearby

public void isNearby (Location other, 
                float distanceM)

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

Parameters
other Location

distanceM float

isNotAt

public void isNotAt (Location other)

Parameters
other Location

isNotAt

public void isNotAt (double latitude, 
                double longitude)

Parameters
latitude double

longitude double

isNotMock

public void isNotMock ()

locations

public static Factory<LocationSubjectLocation> locations ()

Returns
Factory<LocationSubjectLocation>

speed

public FloatSubject speed ()

Returns
FloatSubject

speedAccuracy

public FloatSubject speedAccuracy ()

Returns
FloatSubject

time

public LongSubject time ()

Returns
LongSubject

verticalAccuracy

public FloatSubject verticalAccuracy ()

Returns
FloatSubject