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

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

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

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

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

    // null safe check
    VecAnchorType actualAnchor = actual.getAnchor();
    if (!Objects.areEqual(actualAnchor, anchor)) {
      failWithMessage(assertjErrorMessage, actual, anchor, actualAnchor);
    }

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

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

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

    // null safe check
    VecNumericalValue actualOffset = actual.getOffset();
    if (!Objects.areEqual(actualOffset, offset)) {
      failWithMessage(assertjErrorMessage, actual, offset, actualOffset);
    }

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

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

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

    // null safe check
    VecTopologySegment actualReferencedSegment = actual.getReferencedSegment();
    if (!Objects.areEqual(actualReferencedSegment, referencedSegment)) {
      failWithMessage(assertjErrorMessage, actual, referencedSegment, actualReferencedSegment);
    }

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

}