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

org.assertj.android.palette.v7.api.graphics.PaletteSwatchAssert Maven / Gradle / Ivy

The newest version!
package org.assertj.android.palette.v7.api.graphics;

import android.support.v7.graphics.Palette;

import org.assertj.core.api.AbstractAssert;

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

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

  public PaletteSwatchAssert hasRgb(int rgb) {
    isNotNull();
    int actualRgb = actual.getRgb();
    assertThat(actualRgb) //
        .overridingErrorMessage("Expected RGB <%s> but was <%s>", rgb, actualRgb) //
        .isEqualTo(rgb);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy