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

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

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

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

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

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

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

    // check that given VecLocation varargs is not null.
    if (definedLocations == null) failWithMessage("Expecting definedLocations 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.getDefinedLocations(), definedLocations);

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

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

    // check that given VecLocation collection is not null.
    if (definedLocations == null) {
      failWithMessage("Expecting definedLocations 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.getDefinedLocations(), definedLocations.toArray());

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

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

    // check that given VecLocation varargs is not null.
    if (definedLocations == null) failWithMessage("Expecting definedLocations 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.getDefinedLocations(), definedLocations);

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

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

    // check that given VecLocation collection is not null.
    if (definedLocations == null) {
      failWithMessage("Expecting definedLocations 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.getDefinedLocations(), definedLocations.toArray());

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

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

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

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

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

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

    // check that given VecLocation collection is not null.
    if (definedLocations == null) {
      failWithMessage("Expecting definedLocations 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.getDefinedLocations(), definedLocations.toArray());

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

  /**
   * Verifies that the actual VecDimension has no definedLocations.
   * @return this assertion object.
   * @throws AssertionError if the actual VecDimension's definedLocations is not empty.
   */
  public S hasNoDefinedLocations() {
    // check that actual VecDimension 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 definedLocations but had :\n  <%s>";

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

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


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

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

    // null safe check
    VecDimensionAnchor actualDimensionAnchor = actual.getDimensionAnchor();
    if (!Objects.areEqual(actualDimensionAnchor, dimensionAnchor)) {
      failWithMessage(assertjErrorMessage, actual, dimensionAnchor, actualDimensionAnchor);
    }

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

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

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

    // null safe check
    String actualIdentification = actual.getIdentification();
    if (!Objects.areEqual(actualIdentification, identification)) {
      failWithMessage(assertjErrorMessage, actual, identification, actualIdentification);
    }

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

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

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

    // null safe check
    VecPlacementSpecification actualParentPlacementSpecification = actual.getParentPlacementSpecification();
    if (!Objects.areEqual(actualParentPlacementSpecification, parentPlacementSpecification)) {
      failWithMessage(assertjErrorMessage, actual, parentPlacementSpecification, actualParentPlacementSpecification);
    }

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

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

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

    // null safe check
    VecPath actualPath = actual.getPath();
    if (!Objects.areEqual(actualPath, path)) {
      failWithMessage(assertjErrorMessage, actual, path, actualPath);
    }

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

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

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

    // null safe check
    VecDimensionAnchor actualReferenceAnchor = actual.getReferenceAnchor();
    if (!Objects.areEqual(actualReferenceAnchor, referenceAnchor)) {
      failWithMessage(assertjErrorMessage, actual, referenceAnchor, actualReferenceAnchor);
    }

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

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

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

    // null safe check
    VecTolerance actualTolerance = actual.getTolerance();
    if (!Objects.areEqual(actualTolerance, tolerance)) {
      failWithMessage(assertjErrorMessage, actual, tolerance, actualTolerance);
    }

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

  /**
   * Verifies that the actual VecDimension's unitComponent is equal to the given one.
   * @param unitComponent the given unitComponent to compare the actual VecDimension's unitComponent to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecDimension's unitComponent is not equal to the given one.
   */
  public S hasUnitComponent(VecUnit unitComponent) {
    // check that actual VecDimension 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 VecDimension is value calculated.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecDimension is not value calculated.
   */
  public S isValueCalculated() {
    // check that actual VecDimension we want to make assertions on is not null.
    isNotNull();

    // null safe check
    if (Objects.areEqual(Boolean.FALSE, actual.isValueCalculated())) {
      failWithMessage("\nExpecting that actual VecDimension is value calculated but is not.");
    }

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

  /**
   * Verifies that the actual VecDimension is not value calculated.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecDimension is value calculated.
   */
  public S isNotValueCalculated() {
    // check that actual VecDimension we want to make assertions on is not null.
    isNotNull();

    // null safe check
    if (Objects.areEqual(Boolean.TRUE, actual.isValueCalculated())) {
      failWithMessage("\nExpecting that actual VecDimension is not value calculated but is.");
    }

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

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

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

    // null safe check
    Double actualValueComponent = actual.getValueComponent();
    if (!Objects.areEqual(actualValueComponent, valueComponent)) {
      failWithMessage(assertjErrorMessage, actual, valueComponent, actualValueComponent);
    }

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

  /**
   * Verifies that the actual VecDimension's valueComponent is close to the given value by less than the given offset.
   * 

* If difference is equal to the offset value, assertion is considered successful. * @param valueComponent the value to compare the actual VecDimension's valueComponent to. * @param assertjOffset the given offset. * @return this assertion object. * @throws AssertionError - if the actual VecDimension's valueComponent is not close enough to the given value. */ public S hasValueComponentCloseTo(Double valueComponent, Double assertjOffset) { // check that actual VecDimension we want to make assertions on is not null. isNotNull(); Double actualValueComponent = actual.getValueComponent(); // overrides the default error message with a more explicit one String assertjErrorMessage = String.format("\nExpecting valueComponent:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>", actualValueComponent, valueComponent, assertjOffset, Math.abs(valueComponent - actualValueComponent)); // check Assertions.assertThat(actualValueComponent).overridingErrorMessage(assertjErrorMessage).isCloseTo(valueComponent, Assertions.within(assertjOffset)); // return the current assertion for method chaining return myself; } }