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

org.fest.assertions.api.android.util.PairAssert Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.util;

import android.util.Pair;
import org.fest.assertions.api.AbstractAssert;

import static org.fest.assertions.api.Assertions.assertThat;

/** Assertions for {@link Pair} instances. */
public class PairAssert extends AbstractAssert, Pair> {
  public PairAssert(Pair actual) {
    super(actual, PairAssert.class);
  }

  public PairAssert hasFirst(F first) {
    isNotNull();
    F actualFirst = actual.first;
    assertThat(actualFirst) //
        .overridingErrorMessage("Expected first value <%s> but was <%s>.", first, actualFirst) //
        .isEqualTo(first);
    return this;
  }

  public PairAssert hasSecond(S second) {
    isNotNull();
    S actualSecond = actual.second;
    assertThat(actualSecond) //
        .overridingErrorMessage("Expected second value <%s> but was <%s>.", second, actualSecond) //
        .isEqualTo(second);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy