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

org.fest.assertions.api.android.widget.AbstractAbsSpinnerAssert Maven / Gradle / Ivy

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

import android.widget.AbsSpinner;
import android.widget.SpinnerAdapter;
import org.fest.assertions.api.Assertions;

public abstract class AbstractAbsSpinnerAssert, A extends AbsSpinner>
    extends AbstractAdapterViewAssert {
  protected AbstractAbsSpinnerAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  public S hasAdapter(SpinnerAdapter adapter) {
    isNotNull();
    SpinnerAdapter actualAdapter = actual.getAdapter();
    Assertions.assertThat(actualAdapter) //
        .overridingErrorMessage("Expected adapter <%s> but was <%s>.", adapter, actualAdapter) //
        .isSameAs(adapter);
    return myself;
  }
}