public class

LocationSubject

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

Class Overview

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()
[Expand]
Inherited Methods
From class com.google.common.truth.Subject
From class java.lang.Object

Public Methods

public FloatSubject accuracy ()

Returns
FloatSubject

public DoubleSubject altitude ()

Returns
DoubleSubject

public static LocationSubject assertThat (Location location)

Parameters
location Location
Returns
LocationSubject

public FloatSubject bearing ()

Returns
FloatSubject

public FloatSubject bearingAccuracy ()

Returns
FloatSubject

public FloatSubject bearingTo (double latitude, double longitude)

Parameters
latitude double
longitude double
Returns
FloatSubject

public FloatSubject bearingTo (Location location)

Parameters
location Location
Returns
FloatSubject

public FloatSubject distanceTo (double latitude, double longitude)

Parameters
latitude double
longitude double
Returns
FloatSubject

public FloatSubject distanceTo (Location location)

Parameters
location Location
Returns
FloatSubject

public void doesNotHaveProvider (String provider)

Parameters
provider String

public LongSubject elapsedRealtimeMillis ()

Returns
LongSubject

public LongSubject elapsedRealtimeNanos ()

Returns
LongSubject

public final BundleSubject extras ()

Returns
BundleSubject

public void hasAccuracy ()

public void hasAltitude ()

public void hasBearing ()

public void hasBearingAccuracy ()

public void hasProvider (String provider)

Parameters
provider String

public void hasSpeed ()

public void hasSpeedAccuracy ()

public void hasVerticalAccuracy ()

public void isAt (double latitude, double longitude)

Parameters
latitude double
longitude double

public void isAt (Location other)

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

Parameters
other Location

public void isEqualTo (Object otherObj)

Parameters
otherObj Object

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

public void isMock ()

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

public void isNotAt (Location other)

Parameters
other Location

public void isNotAt (double latitude, double longitude)

Parameters
latitude double
longitude double

public void isNotMock ()

public static Factory<LocationSubjectLocation> locations ()

Returns
Factory<LocationSubjectLocation>

public FloatSubject speed ()

Returns
FloatSubject

public FloatSubject speedAccuracy ()

Returns
FloatSubject

public LongSubject time ()

Returns
LongSubject

public FloatSubject verticalAccuracy ()

Returns
FloatSubject