LocationSubject


public class LocationSubject extends Subject


Subject for making assertions about Locations.

Summary

Public methods

FloatSubject
DoubleSubject
static LocationSubject
assertThat(Location location)
FloatSubject
FloatSubject
FloatSubject
bearingTo(Location location)
FloatSubject
bearingTo(double latitude, double longitude)
FloatSubject
distanceTo(Location location)
FloatSubject
distanceTo(double latitude, double longitude)
void
LongSubject
LongSubject
final BundleSubject
void
void
void
void
void
hasProvider(String provider)
void
void
void
void
isAt(Location other)

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

void
isAt(double latitude, double longitude)
void
void
isFaraway(Location other, float distanceM)

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

void
void
isNearby(Location other, float distanceM)

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

void
void
isNotAt(double latitude, double longitude)
void
static Subject.Factory<LocationSubjectLocation>
FloatSubject
FloatSubject
LongSubject
FloatSubject

Inherited methods

From com.google.common.truth.Subject
String
final boolean

This method is deprecated.

final void
final void
failWithoutActual(Fact first, Fact[] rest)
final int

This method is deprecated.

final StandardSubjectBuilder
void
isAnyOf(Object first, Object second, @Nullable Object[] rest)
void
void
void
isNoneOf(Object first, Object second, @Nullable Object[] rest)
void
isNotEqualTo(Object unexpected)
void
void
void
final void
void
final void
String

This method is deprecated.

Public methods

accuracy

public FloatSubject accuracy()

altitude

public DoubleSubject altitude()

assertThat

public static LocationSubject assertThat(Location location)

bearing

public FloatSubject bearing()

bearingAccuracy

public FloatSubject bearingAccuracy()

bearingTo

public FloatSubject bearingTo(Location location)

bearingTo

public FloatSubject bearingTo(double latitude, double longitude)

distanceTo

public FloatSubject distanceTo(Location location)

distanceTo

public FloatSubject distanceTo(double latitude, double longitude)

doesNotHaveProvider

public void doesNotHaveProvider(String provider)

elapsedRealtimeMillis

public LongSubject elapsedRealtimeMillis()

elapsedRealtimeNanos

public LongSubject elapsedRealtimeNanos()

extras

public final BundleSubject extras()

hasAccuracy

public void hasAccuracy()

hasAltitude

public void hasAltitude()

hasBearing

public void hasBearing()

hasBearingAccuracy

public void hasBearingAccuracy()

hasProvider

public void hasProvider(String provider)

hasSpeed

public void hasSpeed()

hasSpeedAccuracy

public void hasSpeedAccuracy()

hasVerticalAccuracy

public void hasVerticalAccuracy()

isAt

public void isAt(Location other)

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

isAt

public void isAt(double latitude, double longitude)

isEqualTo

public void isEqualTo(@Nullable Object otherObj)

isFaraway

public void isFaraway(Location other, float distanceM)

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

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.

isNotAt

public void isNotAt(Location other)

isNotAt

public void isNotAt(double latitude, double longitude)

isNotMock

public void isNotMock()

locations

public static Subject.Factory<LocationSubjectLocationlocations()

speed

public FloatSubject speed()

speedAccuracy

public FloatSubject speedAccuracy()

time

public LongSubject time()

verticalAccuracy

public FloatSubject verticalAccuracy()