
com.foursoft.vecmodel.vec120.AbstractVecShrinkableTubeSpecificationAssert Maven / Gradle / Ivy
Show all versions of vec120-assertions Show documentation
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 VecShrinkableTubeSpecification} specific assertions - Generated by CustomAssertionGenerator.
*/
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecShrinkableTubeSpecificationAssert, A extends VecShrinkableTubeSpecification> extends AbstractVecTubeSpecificationAssert {
/**
* Creates a new {@link AbstractVecShrinkableTubeSpecificationAssert}
to make assertions on actual VecShrinkableTubeSpecification.
* @param actual the VecShrinkableTubeSpecification we want to make assertions on.
*/
protected AbstractVecShrinkableTubeSpecificationAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's maximumLongitudinalShrinkage is equal to the given one.
* @param maximumLongitudinalShrinkage the given maximumLongitudinalShrinkage to compare the actual VecShrinkableTubeSpecification's maximumLongitudinalShrinkage to.
* @return this assertion object.
* @throws AssertionError - if the actual VecShrinkableTubeSpecification's maximumLongitudinalShrinkage is not equal to the given one.
*/
public S hasMaximumLongitudinalShrinkage(VecNumericalValue maximumLongitudinalShrinkage) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting maximumLongitudinalShrinkage of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
VecNumericalValue actualMaximumLongitudinalShrinkage = actual.getMaximumLongitudinalShrinkage();
if (!Objects.areEqual(actualMaximumLongitudinalShrinkage, maximumLongitudinalShrinkage)) {
failWithMessage(assertjErrorMessage, actual, maximumLongitudinalShrinkage, actualMaximumLongitudinalShrinkage);
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's resins contains the given VecMaterial elements.
* @param resins the given elements that should be contained in actual VecShrinkableTubeSpecification's resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins does not contain all given VecMaterial elements.
*/
public S hasResins(VecMaterial... resins) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecMaterial varargs is not null.
if (resins == null) failWithMessage("Expecting resins 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.getResins(), resins);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's resins contains the given VecMaterial elements in Collection.
* @param resins the given elements that should be contained in actual VecShrinkableTubeSpecification's resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins does not contain all given VecMaterial elements.
*/
public S hasResins(java.util.Collection extends VecMaterial> resins) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecMaterial collection is not null.
if (resins == null) {
failWithMessage("Expecting resins 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.getResins(), resins.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's resins contains only the given VecMaterial elements and nothing else in whatever order.
* @param resins the given elements that should be contained in actual VecShrinkableTubeSpecification's resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins does not contain all given VecMaterial elements.
*/
public S hasOnlyResins(VecMaterial... resins) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecMaterial varargs is not null.
if (resins == null) failWithMessage("Expecting resins 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.getResins(), resins);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's resins contains only the given VecMaterial elements in Collection and nothing else in whatever order.
* @param resins the given elements that should be contained in actual VecShrinkableTubeSpecification's resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins does not contain all given VecMaterial elements.
*/
public S hasOnlyResins(java.util.Collection extends VecMaterial> resins) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecMaterial collection is not null.
if (resins == null) {
failWithMessage("Expecting resins 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.getResins(), resins.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's resins does not contain the given VecMaterial elements.
*
* @param resins the given elements that should not be in actual VecShrinkableTubeSpecification's resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins contains any given VecMaterial elements.
*/
public S doesNotHaveResins(VecMaterial... resins) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecMaterial varargs is not null.
if (resins == null) failWithMessage("Expecting resins parameter not to be null.");
// check with standard error message (use overridingErrorMessage before contains to set your own message).
Iterables.instance().assertDoesNotContain(info, actual.getResins(), resins);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's resins does not contain the given VecMaterial elements in Collection.
*
* @param resins the given elements that should not be in actual VecShrinkableTubeSpecification's resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins contains any given VecMaterial elements.
*/
public S doesNotHaveResins(java.util.Collection extends VecMaterial> resins) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// check that given VecMaterial collection is not null.
if (resins == null) {
failWithMessage("Expecting resins 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.getResins(), resins.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification has no resins.
* @return this assertion object.
* @throws AssertionError if the actual VecShrinkableTubeSpecification's resins is not empty.
*/
public S hasNoResins() {
// check that actual VecShrinkableTubeSpecification 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 resins but had :\n <%s>";
// check
if (actual.getResins().iterator().hasNext()) {
failWithMessage(assertjErrorMessage, actual, actual.getResins());
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's shrinkingFactor is equal to the given one.
* @param shrinkingFactor the given shrinkingFactor to compare the actual VecShrinkableTubeSpecification's shrinkingFactor to.
* @return this assertion object.
* @throws AssertionError - if the actual VecShrinkableTubeSpecification's shrinkingFactor is not equal to the given one.
*/
public S hasShrinkingFactor(Double shrinkingFactor) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting shrinkingFactor of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
Double actualShrinkingFactor = actual.getShrinkingFactor();
if (!Objects.areEqual(actualShrinkingFactor, shrinkingFactor)) {
failWithMessage(assertjErrorMessage, actual, shrinkingFactor, actualShrinkingFactor);
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's shrinkingFactor 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 shrinkingFactor the value to compare the actual VecShrinkableTubeSpecification's shrinkingFactor to.
* @param assertjOffset the given offset.
* @return this assertion object.
* @throws AssertionError - if the actual VecShrinkableTubeSpecification's shrinkingFactor is not close enough to the given value.
*/
public S hasShrinkingFactorCloseTo(Double shrinkingFactor, Double assertjOffset) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
Double actualShrinkingFactor = actual.getShrinkingFactor();
// overrides the default error message with a more explicit one
String assertjErrorMessage = String.format("\nExpecting shrinkingFactor:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>",
actualShrinkingFactor, shrinkingFactor, assertjOffset, Math.abs(shrinkingFactor - actualShrinkingFactor));
// check
Assertions.assertThat(actualShrinkingFactor).overridingErrorMessage(assertjErrorMessage).isCloseTo(shrinkingFactor, Assertions.within(assertjOffset));
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecShrinkableTubeSpecification's waterAbsorbtion is equal to the given one.
* @param waterAbsorbtion the given waterAbsorbtion to compare the actual VecShrinkableTubeSpecification's waterAbsorbtion to.
* @return this assertion object.
* @throws AssertionError - if the actual VecShrinkableTubeSpecification's waterAbsorbtion is not equal to the given one.
*/
public S hasWaterAbsorbtion(VecNumericalValue waterAbsorbtion) {
// check that actual VecShrinkableTubeSpecification we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting waterAbsorbtion of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
VecNumericalValue actualWaterAbsorbtion = actual.getWaterAbsorbtion();
if (!Objects.areEqual(actualWaterAbsorbtion, waterAbsorbtion)) {
failWithMessage(assertjErrorMessage, actual, waterAbsorbtion, actualWaterAbsorbtion);
}
// return the current assertion for method chaining
return myself;
}
}