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

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

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

import org.assertj.core.internal.Iterables;
import org.assertj.core.util.Objects;

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

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

  /**
   * Verifies that the actual VecPathSegment's controlPoint contains the given VecCartesianPoint2D elements.
   * @param controlPoint the given elements that should be contained in actual VecPathSegment's controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint does not contain all given VecCartesianPoint2D elements.
   */
  public S hasControlPoint(VecCartesianPoint2D... controlPoint) {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // check that given VecCartesianPoint2D varargs is not null.
    if (controlPoint == null) failWithMessage("Expecting controlPoint parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getControlPoint(), controlPoint);

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

  /**
   * Verifies that the actual VecPathSegment's controlPoint contains the given VecCartesianPoint2D elements in Collection.
   * @param controlPoint the given elements that should be contained in actual VecPathSegment's controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint does not contain all given VecCartesianPoint2D elements.
   */
  public S hasControlPoint(java.util.Collection controlPoint) {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // check that given VecCartesianPoint2D collection is not null.
    if (controlPoint == null) {
      failWithMessage("Expecting controlPoint parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getControlPoint(), controlPoint.toArray());

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

  /**
   * Verifies that the actual VecPathSegment's controlPoint contains only the given VecCartesianPoint2D elements and nothing else in whatever order.
   * @param controlPoint the given elements that should be contained in actual VecPathSegment's controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint does not contain all given VecCartesianPoint2D elements.
   */
  public S hasOnlyControlPoint(VecCartesianPoint2D... controlPoint) {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // check that given VecCartesianPoint2D varargs is not null.
    if (controlPoint == null) failWithMessage("Expecting controlPoint parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContainsOnly(info, actual.getControlPoint(), controlPoint);

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

  /**
   * Verifies that the actual VecPathSegment's controlPoint contains only the given VecCartesianPoint2D elements in Collection and nothing else in whatever order.
   * @param controlPoint the given elements that should be contained in actual VecPathSegment's controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint does not contain all given VecCartesianPoint2D elements.
   */
  public S hasOnlyControlPoint(java.util.Collection controlPoint) {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // check that given VecCartesianPoint2D collection is not null.
    if (controlPoint == null) {
      failWithMessage("Expecting controlPoint parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContainsOnly(info, actual.getControlPoint(), controlPoint.toArray());

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

  /**
   * Verifies that the actual VecPathSegment's controlPoint does not contain the given VecCartesianPoint2D elements.
   *
   * @param controlPoint the given elements that should not be in actual VecPathSegment's controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint contains any given VecCartesianPoint2D elements.
   */
  public S doesNotHaveControlPoint(VecCartesianPoint2D... controlPoint) {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // check that given VecCartesianPoint2D varargs is not null.
    if (controlPoint == null) failWithMessage("Expecting controlPoint parameter not to be null.");

    // check with standard error message (use overridingErrorMessage before contains to set your own message).
    Iterables.instance().assertDoesNotContain(info, actual.getControlPoint(), controlPoint);

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

  /**
   * Verifies that the actual VecPathSegment's controlPoint does not contain the given VecCartesianPoint2D elements in Collection.
   *
   * @param controlPoint the given elements that should not be in actual VecPathSegment's controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint contains any given VecCartesianPoint2D elements.
   */
  public S doesNotHaveControlPoint(java.util.Collection controlPoint) {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // check that given VecCartesianPoint2D collection is not null.
    if (controlPoint == null) {
      failWithMessage("Expecting controlPoint parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message (use overridingErrorMessage before contains to set your own message).
    Iterables.instance().assertDoesNotContain(info, actual.getControlPoint(), controlPoint.toArray());

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

  /**
   * Verifies that the actual VecPathSegment has no controlPoint.
   * @return this assertion object.
   * @throws AssertionError if the actual VecPathSegment's controlPoint is not empty.
   */
  public S hasNoControlPoint() {
    // check that actual VecPathSegment we want to make assertions on is not null.
    isNotNull();

    // we override the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting :\n  <%s>\nnot to have controlPoint but had :\n  <%s>";

    // check
    if (actual.getControlPoint().iterator().hasNext()) {
      failWithMessage(assertjErrorMessage, actual, actual.getControlPoint());
    }

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


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

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

    // null safe check
    VecNumericalValue actualCurveRadius = actual.getCurveRadius();
    if (!Objects.areEqual(actualCurveRadius, curveRadius)) {
      failWithMessage(assertjErrorMessage, actual, curveRadius, actualCurveRadius);
    }

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

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

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

    // null safe check
    VecGeometrySegment2D actualParentGeometrySegment2D = actual.getParentGeometrySegment2D();
    if (!Objects.areEqual(actualParentGeometrySegment2D, parentGeometrySegment2D)) {
      failWithMessage(assertjErrorMessage, actual, parentGeometrySegment2D, actualParentGeometrySegment2D);
    }

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

}