org.fest.assertions.api.android.location.GpsStatusAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fest-android Show documentation
Show all versions of fest-android Show documentation
A set of FEST assertion helpers geared toward testing Android.
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.location;
import android.location.GpsStatus;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link GpsStatus} instances. */
public class GpsStatusAssert extends AbstractAssert {
public GpsStatusAssert(GpsStatus actual) {
super(actual, GpsStatusAssert.class);
}
public GpsStatusAssert hasMaximumSatellites(int count) {
isNotNull();
int actualCount = actual.getMaxSatellites();
assertThat(actualCount) //
.overridingErrorMessage("Expected maximum satellites <%s> but was <%s>.", count,
actualCount) //
.isEqualTo(count);
return this;
}
public GpsStatusAssert hasTimeToFirstFix(int time) {
isNotNull();
int actualTime = actual.getTimeToFirstFix();
assertThat(actualTime) //
.overridingErrorMessage("Expected time to first fix <%s> but was <%s>.", time,
actualTime) //
.isEqualTo(time);
return this;
}
}