All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.assertj.android.api.location.GpsStatusAssert Maven / Gradle / Ivy

The newest version!
// Copyright 2013 Square, Inc.
package org.assertj.android.api.location;

import android.location.GpsStatus;
import org.assertj.core.api.AbstractAssert;

import static org.assertj.core.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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy