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

org.fest.assertions.api.android.view.ViewStubAssert Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package org.fest.assertions.api.android.view;

import android.view.ViewStub;

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

/** Assertions for {@link ViewStub} instances. */
public class ViewStubAssert extends AbstractViewAssert {
  public ViewStubAssert(ViewStub actual) {
    super(actual, ViewStubAssert.class);
  }

  public ViewStubAssert hasInflatedId(int id) {
    isNotNull();
    int actualId = actual.getInflatedId();
    assertThat(actualId) //
        .overridingErrorMessage("Expected view stub inflated ID <%s> but was <%s>", id, actualId) //
        .isEqualTo(id);
    return this;
  }

  public ViewStubAssert hasLayoutResource(int resId) {
    isNotNull();
    int actualResId = actual.getLayoutResource();
    assertThat(actualResId) //
        .overridingErrorMessage("Expected view stub layout resource <%s> but was <%s>", resId,
            actualResId) //
        .isEqualTo(resId);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy