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

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

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

import org.assertj.core.util.Objects;

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

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

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

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

    // null safe check
    VecUSUnitName actualUsUnitName = actual.getUsUnitName();
    if (!Objects.areEqual(actualUsUnitName, usUnitName)) {
      failWithMessage(assertjErrorMessage, actual, usUnitName, actualUsUnitName);
    }

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

}