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

com.foursoft.vecmodel.vec120.AbstractVecInstructionAssert 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 VecInstruction} specific assertions - Generated by CustomAssertionGenerator.
 */
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecInstructionAssert, A extends VecInstruction> extends AbstractVecExtendableElementAssert {

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

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

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

    // null safe check
    VecOccurrenceOrUsage actualParentOccurrenceOrUsage = actual.getParentOccurrenceOrUsage();
    if (!Objects.areEqual(actualParentOccurrenceOrUsage, parentOccurrenceOrUsage)) {
      failWithMessage(assertjErrorMessage, actual, parentOccurrenceOrUsage, actualParentOccurrenceOrUsage);
    }

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

}