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

com.foursoft.vecmodel.vec120.AbstractVecFlatCoreSpecificationAssert Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package com.foursoft.vecmodel.vec120;

import org.assertj.core.util.Objects;

/**
 * Abstract base class for {@link VecFlatCoreSpecification} specific assertions - Generated by CustomAssertionGenerator.
 */
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecFlatCoreSpecificationAssert, A extends VecFlatCoreSpecification> extends AbstractVecConductorSpecificationAssert {

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

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

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

    // null safe check
    VecSize actualSize = actual.getSize();
    if (!Objects.areEqual(actualSize, size)) {
      failWithMessage(assertjErrorMessage, actual, size, actualSize);
    }

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

}