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

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

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

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

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

    // null safe check
    VecConnectionEnd actualConnectionEnd = actual.getConnectionEnd();
    if (!Objects.areEqual(actualConnectionEnd, connectionEnd)) {
      failWithMessage(assertjErrorMessage, actual, connectionEnd, actualConnectionEnd);
    }

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

  /**
   * Verifies that the actual VecWireEnd's identification is equal to the given one.
   * @param identification the given identification to compare the actual VecWireEnd's identification to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecWireEnd's identification is not equal to the given one.
   */
  public S hasIdentification(String identification) {
    // check that actual VecWireEnd 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 VecWireEnd's parentWireElementReference is equal to the given one.
   * @param parentWireElementReference the given parentWireElementReference to compare the actual VecWireEnd's parentWireElementReference to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecWireEnd's parentWireElementReference is not equal to the given one.
   */
  public S hasParentWireElementReference(VecWireElementReference parentWireElementReference) {
    // check that actual VecWireEnd we want to make assertions on is not null.
    isNotNull();

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

    // null safe check
    VecWireElementReference actualParentWireElementReference = actual.getParentWireElementReference();
    if (!Objects.areEqual(actualParentWireElementReference, parentWireElementReference)) {
      failWithMessage(assertjErrorMessage, actual, parentWireElementReference, actualParentWireElementReference);
    }

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

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

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

    // check value for positionOnWire
    double actualPositionOnWire = actual.getPositionOnWire();
    if (actualPositionOnWire != positionOnWire) {
      failWithMessage(assertjErrorMessage, actual, positionOnWire, actualPositionOnWire);
    }

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

  /**
   * Verifies that the actual VecWireEnd's positionOnWire 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 positionOnWire the value to compare the actual VecWireEnd's positionOnWire to. * @param assertjOffset the given offset. * @return this assertion object. * @throws AssertionError - if the actual VecWireEnd's positionOnWire is not close enough to the given value. */ public S hasPositionOnWireCloseTo(double positionOnWire, double assertjOffset) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); double actualPositionOnWire = actual.getPositionOnWire(); // overrides the default error message with a more explicit one String assertjErrorMessage = String.format("\nExpecting positionOnWire:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>", actualPositionOnWire, positionOnWire, assertjOffset, Math.abs(positionOnWire - actualPositionOnWire)); // check Assertions.assertThat(actualPositionOnWire).overridingErrorMessage(assertjErrorMessage).isCloseTo(positionOnWire, Assertions.within(assertjOffset)); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMounting contains the given VecWireMounting elements. * @param refWireMounting the given elements that should be contained in actual VecWireEnd's refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting does not contain all given VecWireMounting elements. */ public S hasRefWireMounting(VecWireMounting... refWireMounting) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMounting varargs is not null. if (refWireMounting == null) failWithMessage("Expecting refWireMounting 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.getRefWireMounting(), refWireMounting); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMounting contains the given VecWireMounting elements in Collection. * @param refWireMounting the given elements that should be contained in actual VecWireEnd's refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting does not contain all given VecWireMounting elements. */ public S hasRefWireMounting(java.util.Collection refWireMounting) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMounting collection is not null. if (refWireMounting == null) { failWithMessage("Expecting refWireMounting 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.getRefWireMounting(), refWireMounting.toArray()); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMounting contains only the given VecWireMounting elements and nothing else in whatever order. * @param refWireMounting the given elements that should be contained in actual VecWireEnd's refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting does not contain all given VecWireMounting elements. */ public S hasOnlyRefWireMounting(VecWireMounting... refWireMounting) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMounting varargs is not null. if (refWireMounting == null) failWithMessage("Expecting refWireMounting 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.getRefWireMounting(), refWireMounting); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMounting contains only the given VecWireMounting elements in Collection and nothing else in whatever order. * @param refWireMounting the given elements that should be contained in actual VecWireEnd's refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting does not contain all given VecWireMounting elements. */ public S hasOnlyRefWireMounting(java.util.Collection refWireMounting) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMounting collection is not null. if (refWireMounting == null) { failWithMessage("Expecting refWireMounting 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.getRefWireMounting(), refWireMounting.toArray()); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMounting does not contain the given VecWireMounting elements. * * @param refWireMounting the given elements that should not be in actual VecWireEnd's refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting contains any given VecWireMounting elements. */ public S doesNotHaveRefWireMounting(VecWireMounting... refWireMounting) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMounting varargs is not null. if (refWireMounting == null) failWithMessage("Expecting refWireMounting parameter not to be null."); // check with standard error message (use overridingErrorMessage before contains to set your own message). Iterables.instance().assertDoesNotContain(info, actual.getRefWireMounting(), refWireMounting); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMounting does not contain the given VecWireMounting elements in Collection. * * @param refWireMounting the given elements that should not be in actual VecWireEnd's refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting contains any given VecWireMounting elements. */ public S doesNotHaveRefWireMounting(java.util.Collection refWireMounting) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMounting collection is not null. if (refWireMounting == null) { failWithMessage("Expecting refWireMounting 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.getRefWireMounting(), refWireMounting.toArray()); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd has no refWireMounting. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMounting is not empty. */ public S hasNoRefWireMounting() { // check that actual VecWireEnd 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 refWireMounting but had :\n <%s>"; // check if (actual.getRefWireMounting().iterator().hasNext()) { failWithMessage(assertjErrorMessage, actual, actual.getRefWireMounting()); } // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMountingDetail contains the given VecWireMountingDetail elements. * @param refWireMountingDetail the given elements that should be contained in actual VecWireEnd's refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail does not contain all given VecWireMountingDetail elements. */ public S hasRefWireMountingDetail(VecWireMountingDetail... refWireMountingDetail) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMountingDetail varargs is not null. if (refWireMountingDetail == null) failWithMessage("Expecting refWireMountingDetail 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.getRefWireMountingDetail(), refWireMountingDetail); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMountingDetail contains the given VecWireMountingDetail elements in Collection. * @param refWireMountingDetail the given elements that should be contained in actual VecWireEnd's refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail does not contain all given VecWireMountingDetail elements. */ public S hasRefWireMountingDetail(java.util.Collection refWireMountingDetail) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMountingDetail collection is not null. if (refWireMountingDetail == null) { failWithMessage("Expecting refWireMountingDetail 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.getRefWireMountingDetail(), refWireMountingDetail.toArray()); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMountingDetail contains only the given VecWireMountingDetail elements and nothing else in whatever order. * @param refWireMountingDetail the given elements that should be contained in actual VecWireEnd's refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail does not contain all given VecWireMountingDetail elements. */ public S hasOnlyRefWireMountingDetail(VecWireMountingDetail... refWireMountingDetail) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMountingDetail varargs is not null. if (refWireMountingDetail == null) failWithMessage("Expecting refWireMountingDetail 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.getRefWireMountingDetail(), refWireMountingDetail); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMountingDetail contains only the given VecWireMountingDetail elements in Collection and nothing else in whatever order. * @param refWireMountingDetail the given elements that should be contained in actual VecWireEnd's refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail does not contain all given VecWireMountingDetail elements. */ public S hasOnlyRefWireMountingDetail(java.util.Collection refWireMountingDetail) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMountingDetail collection is not null. if (refWireMountingDetail == null) { failWithMessage("Expecting refWireMountingDetail 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.getRefWireMountingDetail(), refWireMountingDetail.toArray()); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMountingDetail does not contain the given VecWireMountingDetail elements. * * @param refWireMountingDetail the given elements that should not be in actual VecWireEnd's refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail contains any given VecWireMountingDetail elements. */ public S doesNotHaveRefWireMountingDetail(VecWireMountingDetail... refWireMountingDetail) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMountingDetail varargs is not null. if (refWireMountingDetail == null) failWithMessage("Expecting refWireMountingDetail parameter not to be null."); // check with standard error message (use overridingErrorMessage before contains to set your own message). Iterables.instance().assertDoesNotContain(info, actual.getRefWireMountingDetail(), refWireMountingDetail); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd's refWireMountingDetail does not contain the given VecWireMountingDetail elements in Collection. * * @param refWireMountingDetail the given elements that should not be in actual VecWireEnd's refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail contains any given VecWireMountingDetail elements. */ public S doesNotHaveRefWireMountingDetail(java.util.Collection refWireMountingDetail) { // check that actual VecWireEnd we want to make assertions on is not null. isNotNull(); // check that given VecWireMountingDetail collection is not null. if (refWireMountingDetail == null) { failWithMessage("Expecting refWireMountingDetail 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.getRefWireMountingDetail(), refWireMountingDetail.toArray()); // return the current assertion for method chaining return myself; } /** * Verifies that the actual VecWireEnd has no refWireMountingDetail. * @return this assertion object. * @throws AssertionError if the actual VecWireEnd's refWireMountingDetail is not empty. */ public S hasNoRefWireMountingDetail() { // check that actual VecWireEnd 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 refWireMountingDetail but had :\n <%s>"; // check if (actual.getRefWireMountingDetail().iterator().hasNext()) { failWithMessage(assertjErrorMessage, actual, actual.getRefWireMountingDetail()); } // return the current assertion for method chaining return myself; } }