package org.nzbhydra.mapping.newznab.xml;

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

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

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

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

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

        // null safe check
        Integer actualOffset = actual.getOffset();
        if (!Objects.areEqual(actualOffset, offset)) {
            failWithMessage(assertjErrorMessage, actual, offset, actualOffset);
        }

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

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

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

        // null safe check
        Integer actualTotal = actual.getTotal();
        if (!Objects.areEqual(actualTotal, total)) {
            failWithMessage(assertjErrorMessage, actual, total, actualTotal);
        }

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

}
