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

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

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

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

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

    // null safe check
    String actualCompanyName = actual.getCompanyName();
    if (!Objects.areEqual(actualCompanyName, companyName)) {
      failWithMessage(assertjErrorMessage, actual, companyName, actualCompanyName);
    }

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

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

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

    // null safe check
    String actualContractRole = actual.getContractRole();
    if (!Objects.areEqual(actualContractRole, contractRole)) {
      failWithMessage(assertjErrorMessage, actual, contractRole, actualContractRole);
    }

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

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

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

    // null safe check
    VecContent actualParentVecContent = actual.getParentVecContent();
    if (!Objects.areEqual(actualParentVecContent, parentVecContent)) {
      failWithMessage(assertjErrorMessage, actual, parentVecContent, actualParentVecContent);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


}