
com.foursoft.vecmodel.vec120.AbstractVecSIUnitAssert 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.util.Objects;
/**
* Abstract base class for {@link VecSIUnit} specific assertions - Generated by CustomAssertionGenerator.
*/
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecSIUnitAssert, A extends VecSIUnit> extends AbstractVecUnitAssert {
/**
* Creates a new {@link AbstractVecSIUnitAssert}
to make assertions on actual VecSIUnit.
* @param actual the VecSIUnit we want to make assertions on.
*/
protected AbstractVecSIUnitAssert(A actual, Class selfType) {
super(actual, selfType);
}
/**
* Verifies that the actual VecSIUnit's siPrefix is equal to the given one.
* @param siPrefix the given siPrefix to compare the actual VecSIUnit's siPrefix to.
* @return this assertion object.
* @throws AssertionError - if the actual VecSIUnit's siPrefix is not equal to the given one.
*/
public S hasSiPrefix(VecSiPrefix siPrefix) {
// check that actual VecSIUnit we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting siPrefix of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
VecSiPrefix actualSiPrefix = actual.getSiPrefix();
if (!Objects.areEqual(actualSiPrefix, siPrefix)) {
failWithMessage(assertjErrorMessage, actual, siPrefix, actualSiPrefix);
}
// return the current assertion for method chaining
return myself;
}
/**
* Verifies that the actual VecSIUnit's siUnitName is equal to the given one.
* @param siUnitName the given siUnitName to compare the actual VecSIUnit's siUnitName to.
* @return this assertion object.
* @throws AssertionError - if the actual VecSIUnit's siUnitName is not equal to the given one.
*/
public S hasSiUnitName(VecSiUnitName siUnitName) {
// check that actual VecSIUnit we want to make assertions on is not null.
isNotNull();
// overrides the default error message with a more explicit one
String assertjErrorMessage = "\nExpecting siUnitName of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>";
// null safe check
VecSiUnitName actualSiUnitName = actual.getSiUnitName();
if (!Objects.areEqual(actualSiUnitName, siUnitName)) {
failWithMessage(assertjErrorMessage, actual, siUnitName, actualSiUnitName);
}
// return the current assertion for method chaining
return myself;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy