
com.foursoft.vecmodel.vec120.AbstractVecCompositeUnitAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vec120-assertions Show documentation
Show all versions of vec120-assertions Show documentation
The Assertions Library for VEC version 1.2.0.
package com.foursoft.vecmodel.vec120;
import org.assertj.core.internal.Iterables;
/**
* Abstract base class for {@link VecCompositeUnit} specific assertions - Generated by CustomAssertionGenerator.
*/
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecCompositeUnitAssert, A extends VecCompositeUnit> extends AbstractVecUnitAssert {
/**
* Creates a new {@link AbstractVecCompositeUnitAssert}
to make assertions on actual VecCompositeUnit.
* @param actual the VecCompositeUnit we want to make assertions on.
*/
protected AbstractVecCompositeUnitAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Verifies that the actual VecCompositeUnit's factors contains the given VecUnit elements.
* @param factors the given elements that should be contained in actual VecCompositeUnit's factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors does not contain all given VecUnit elements.
*/
public S hasFactors(VecUnit... factors) {
// check that actual VecCompositeUnit we want to make assertions on is not null.
isNotNull();
// check that given VecUnit varargs is not null.
if (factors == null) failWithMessage("Expecting factors 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.getFactors(), factors);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecCompositeUnit's factors contains the given VecUnit elements in Collection.
* @param factors the given elements that should be contained in actual VecCompositeUnit's factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors does not contain all given VecUnit elements.
*/
public S hasFactors(java.util.Collection extends VecUnit> factors) {
// check that actual VecCompositeUnit we want to make assertions on is not null.
isNotNull();
// check that given VecUnit collection is not null.
if (factors == null) {
failWithMessage("Expecting factors 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.getFactors(), factors.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecCompositeUnit's factors contains only the given VecUnit elements and nothing else in whatever order.
* @param factors the given elements that should be contained in actual VecCompositeUnit's factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors does not contain all given VecUnit elements.
*/
public S hasOnlyFactors(VecUnit... factors) {
// check that actual VecCompositeUnit we want to make assertions on is not null.
isNotNull();
// check that given VecUnit varargs is not null.
if (factors == null) failWithMessage("Expecting factors 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.getFactors(), factors);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecCompositeUnit's factors contains only the given VecUnit elements in Collection and nothing else in whatever order.
* @param factors the given elements that should be contained in actual VecCompositeUnit's factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors does not contain all given VecUnit elements.
*/
public S hasOnlyFactors(java.util.Collection extends VecUnit> factors) {
// check that actual VecCompositeUnit we want to make assertions on is not null.
isNotNull();
// check that given VecUnit collection is not null.
if (factors == null) {
failWithMessage("Expecting factors 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.getFactors(), factors.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecCompositeUnit's factors does not contain the given VecUnit elements.
*
* @param factors the given elements that should not be in actual VecCompositeUnit's factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors contains any given VecUnit elements.
*/
public S doesNotHaveFactors(VecUnit... factors) {
// check that actual VecCompositeUnit we want to make assertions on is not null.
isNotNull();
// check that given VecUnit varargs is not null.
if (factors == null) failWithMessage("Expecting factors parameter not to be null.");
// check with standard error message (use overridingErrorMessage before contains to set your own message).
Iterables.instance().assertDoesNotContain(info, actual.getFactors(), factors);
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecCompositeUnit's factors does not contain the given VecUnit elements in Collection.
*
* @param factors the given elements that should not be in actual VecCompositeUnit's factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors contains any given VecUnit elements.
*/
public S doesNotHaveFactors(java.util.Collection extends VecUnit> factors) {
// check that actual VecCompositeUnit we want to make assertions on is not null.
isNotNull();
// check that given VecUnit collection is not null.
if (factors == null) {
failWithMessage("Expecting factors 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.getFactors(), factors.toArray());
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecCompositeUnit has no factors.
* @return this assertion object.
* @throws AssertionError if the actual VecCompositeUnit's factors is not empty.
*/
public S hasNoFactors() {
// check that actual VecCompositeUnit 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 factors but had :\n <%s>";
// check
if (actual.getFactors().iterator().hasNext()) {
failWithMessage(assertjErrorMessage, actual, actual.getFactors());
}
// return the current assertion for method chaining
return myself;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy