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

org.assertj.android.api.widget.SimpleAdapterAssert 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.Filter;
import android.widget.SimpleAdapter;

import static org.assertj.core.api.Assertions.assertThat;

/** Assertions for {@link SimpleAdapter} instances. */
public class SimpleAdapterAssert
    extends AbstractListAdapterAssert {
  public SimpleAdapterAssert(SimpleAdapter actual) {
    super(actual, SimpleAdapterAssert.class);
  }

  public SimpleAdapterAssert hasFilter(Filter filter) {
    isNotNull();
    Filter actualFilter = actual.getFilter();
    assertThat(actualFilter) //
        .overridingErrorMessage("Expected filter <%s> but was <%s>.", filter, actualFilter) //
        .isSameAs(filter);
    return this;
  }

  public SimpleAdapterAssert hasViewBinder(SimpleAdapter.ViewBinder binder) {
    isNotNull();
    SimpleAdapter.ViewBinder actualBinder = actual.getViewBinder();
    assertThat(actualBinder) //
        .overridingErrorMessage("Expected view binder <%s> but was <%s>.", binder, actualBinder) //
        .isSameAs(binder);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy