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

com.foursoft.vecmodel.vec120.AbstractVecValueWithUnitAssert Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package com.foursoft.vecmodel.vec120;

import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.util.Objects;

/**
 * Abstract base class for {@link VecValueWithUnit} specific assertions - Generated by CustomAssertionGenerator.
 */
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecValueWithUnitAssert, A extends VecValueWithUnit> extends AbstractObjectAssert {

  /**
   * Creates a new {@link AbstractVecValueWithUnitAssert} to make assertions on actual VecValueWithUnit.
   * @param actual the VecValueWithUnit we want to make assertions on.
   */
  protected AbstractVecValueWithUnitAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  /**
   * Verifies that the actual VecValueWithUnit's unitComponent is equal to the given one.
   * @param unitComponent the given unitComponent to compare the actual VecValueWithUnit's unitComponent to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecValueWithUnit's unitComponent is not equal to the given one.
   */
  public S hasUnitComponent(VecUnit unitComponent) {
    // check that actual VecValueWithUnit we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting unitComponent of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    VecUnit actualUnitComponent = actual.getUnitComponent();
    if (!Objects.areEqual(actualUnitComponent, unitComponent)) {
      failWithMessage(assertjErrorMessage, actual, unitComponent, actualUnitComponent);
    }

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecValueWithUnit's xmlId is equal to the given one.
   * @param xmlId the given xmlId to compare the actual VecValueWithUnit's xmlId to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecValueWithUnit's xmlId is not equal to the given one.
   */
  public S hasXmlId(String xmlId) {
    // check that actual VecValueWithUnit we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting xmlId of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    String actualXmlId = actual.getXmlId();
    if (!Objects.areEqual(actualXmlId, xmlId)) {
      failWithMessage(assertjErrorMessage, actual, xmlId, actualXmlId);
    }

    // return the current assertion for method chaining
    return myself;
  }

}