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

org.assertj.android.api.widget.AbstractAbsSpinnerAssert Maven / Gradle / Ivy

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

import android.widget.AbsSpinner;
import android.widget.SpinnerAdapter;
import org.assertj.core.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;
  }
}