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

org.assertj.android.api.graphics.PictureAssert Maven / Gradle / Ivy

The newest version!
// Copyright 2013 Square, Inc.
package org.assertj.android.api.graphics;

import android.graphics.Picture;
import org.assertj.core.api.AbstractAssert;

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

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

  public PictureAssert hasHeight(int height) {
    isNotNull();
    int actualHeight = actual.getHeight();
    assertThat(actualHeight) //
        .overridingErrorMessage("Expected height <%s> but was <%s>.", height, actualHeight) //
        .isEqualTo(height);
    return this;
  }

  public PictureAssert hasWidth(int width) {
    isNotNull();
    int actualWidth = actual.getWidth();
    assertThat(actualWidth) //
        .overridingErrorMessage("Expected width <%s> but was <%s>.", width, actualWidth) //
        .isEqualTo(width);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy