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

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

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

import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.util.Objects;

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

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

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

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

    // null safe check
    VecWriter actualLocalWriter = actual.getLocalWriter();
    if (!Objects.areEqual(actualLocalWriter, localWriter)) {
      failWithMessage(assertjErrorMessage, actual, localWriter, actualLocalWriter);
    }

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

}