# LocationSubject

Artifact: [androidx.test.ext:truth](https://developer.android.com/jetpack/androidx/releases/test-ext) [View Source](https://cs.android.com/search?q=file:androidx/test/ext/truth/location/LocationSubject.java+class:androidx.test.ext.truth.location.LocationSubject)

*** ** * ** ***

<br />

```
class LocationSubject : Subject
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) ||
|   | ↳ | [androidx.test.ext.truth.location.LocationSubject](https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject) |

*** ** * ** ***

Subject for making assertions about `https://developer.android.com/reference/android/location/Location.html`s.

## Summary

| ### Public functions |
|---|---|
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#accuracy()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/DoubleSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#altitude()()` |
| `java-static https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#assertThat(android.location.Location)(location: https://developer.android.com/reference/android/location/Location.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#bearing()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#bearingAccuracy()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#bearingTo(android.location.Location)(location: https://developer.android.com/reference/android/location/Location.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#bearingTo(double,double)(latitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, longitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#distanceTo(android.location.Location)(location: https://developer.android.com/reference/android/location/Location.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#distanceTo(double,double)(latitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, longitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#doesNotHaveProvider(java.lang.String)(provider: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://truth.dev/api/0.41/com/google/common/truth/LongSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#elapsedRealtimeMillis()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/LongSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#elapsedRealtimeNanos()()` |
| `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/os/BundleSubject!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#extras()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasAccuracy()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasAltitude()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasBearing()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasBearingAccuracy()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasProvider(java.lang.String)(provider: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasSpeed()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasSpeedAccuracy()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#hasVerticalAccuracy()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isAt(android.location.Location)(other: https://developer.android.com/reference/android/location/Location.html!)` Verifies that the location is at the same latitude/longitude as another location. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isAt(double,double)(latitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, longitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isEqualTo(java.lang.Object)(otherObj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isFaraway(android.location.Location,float)(other: https://developer.android.com/reference/android/location/Location.html!, distanceM: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Verifies that the location is at least `distanceM` meters away from another location. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isMock()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isNearby(android.location.Location,float)(other: https://developer.android.com/reference/android/location/Location.html!, distanceM: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Verifies that the location is at most `distanceM` meters away from another location. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isNotAt(android.location.Location)(other: https://developer.android.com/reference/android/location/Location.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isNotAt(double,double)(latitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, longitude: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#isNotMock()()` |
| `java-static https://truth.dev/api/0.41/com/google/common/truth/Subject.Factory.html<https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject!, https://developer.android.com/reference/android/location/Location.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#locations()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#speed()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#speedAccuracy()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/LongSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#time()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html!` | `https://developer.android.com/reference/kotlin/androidx/test/ext/truth/location/LocationSubject#verticalAccuracy()()` |

### Inherited functions

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(first: https://truth.dev/api/0.41/com/google/common/truth/Fact.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://truth.dev/api/0.41/com/google/common/truth/Fact.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This function is deprecated.**
`https://truth.dev/api/0.41/com/google/common/truth/StandardSubjectBuilder.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#ignoreCheck--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(iterable: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(clazz: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!, rest: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(unexpected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(iterable: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(clazz: https://developer.android.com/reference/java/lang/Class.html<*>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(unexpected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public functions

### accuracy

```
fun accuracy(): FloatSubject!
```

### altitude

```
fun altitude(): DoubleSubject!
```

### assertThat

```
java-static fun assertThat(location: Location!): LocationSubject!
```

### bearing

```
fun bearing(): FloatSubject!
```

### bearingAccuracy

```
fun bearingAccuracy(): FloatSubject!
```

### bearingTo

```
fun bearingTo(location: Location!): FloatSubject!
```

### bearingTo

```
fun bearingTo(latitude: Double, longitude: Double): FloatSubject!
```

### distanceTo

```
fun distanceTo(location: Location!): FloatSubject!
```

### distanceTo

```
fun distanceTo(latitude: Double, longitude: Double): FloatSubject!
```

### doesNotHaveProvider

```
fun doesNotHaveProvider(provider: String!): Unit
```

### elapsedRealtimeMillis

```
fun elapsedRealtimeMillis(): LongSubject!
```

### elapsedRealtimeNanos

```
fun elapsedRealtimeNanos(): LongSubject!
```

### extras

```
fun extras(): BundleSubject!
```

### hasAccuracy

```
fun hasAccuracy(): Unit
```

### hasAltitude

```
fun hasAltitude(): Unit
```

### hasBearing

```
fun hasBearing(): Unit
```

### hasBearingAccuracy

```
fun hasBearingAccuracy(): Unit
```

### hasProvider

```
fun hasProvider(provider: String!): Unit
```

### hasSpeed

```
fun hasSpeed(): Unit
```

### hasSpeedAccuracy

```
fun hasSpeedAccuracy(): Unit
```

### hasVerticalAccuracy

```
fun hasVerticalAccuracy(): Unit
```

### isAt

```
fun isAt(other: Location!): Unit
```

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

### isAt

```
fun isAt(latitude: Double, longitude: Double): Unit
```

### isEqualTo

```
fun isEqualTo(otherObj: Any?): Unit
```

### isFaraway

```
fun isFaraway(other: Location!, distanceM: Float): Unit
```

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

### isMock

```
fun isMock(): Unit
```

### isNearby

```
fun isNearby(other: Location!, distanceM: Float): Unit
```

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

### isNotAt

```
fun isNotAt(other: Location!): Unit
```

### isNotAt

```
fun isNotAt(latitude: Double, longitude: Double): Unit
```

### isNotMock

```
fun isNotMock(): Unit
```

### locations

```
java-static fun locations(): Subject.Factory<LocationSubject!, Location!>!
```

### speed

```
fun speed(): FloatSubject!
```

### speedAccuracy

```
fun speedAccuracy(): FloatSubject!
```

### time

```
fun time(): LongSubject!
```

### verticalAccuracy

```
fun verticalAccuracy(): FloatSubject!
```