package org.nzbhydra.mapping.newznab.json.caps;

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

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

    /**
     * Creates a new <code>{@link AbstractCapsJsonLimitsAttributesAssert}</code> to make assertions on actual CapsJsonLimitsAttributes.
     *
     * @param actual the CapsJsonLimitsAttributes we want to make assertions on.
     */
    protected AbstractCapsJsonLimitsAttributesAssert(A actual, Class<S> selfType) {
        super(actual, selfType);
    }

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

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

        // null safe check
        String actualMax = actual.getMax();
        if (!Objects.areEqual(actualMax, max)) {
            failWithMessage(assertjErrorMessage, actual, max, actualMax);
        }

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

}
