package org.nzbhydra.mapping.newznab.mock;

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

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

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

    /**
     * Verifies that the actual NewznabMockBuilder's caps is equal to the given one.
     *
     * @param caps the given caps to compare the actual NewznabMockBuilder's caps to.
     * @return this assertion object.
     * @throws AssertionError - if the actual NewznabMockBuilder's caps is not equal to the given one.
     */
    public S hasCaps(org.nzbhydra.mapping.newznab.xml.caps.CapsXmlRoot caps) {
        // check that actual NewznabMockBuilder we want to make assertions on is not null.
        isNotNull();

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

        // null safe check
        org.nzbhydra.mapping.newznab.xml.caps.CapsXmlRoot actualCaps = actual.getCaps();
        if (!Objects.areEqual(actualCaps, caps)) {
            failWithMessage(assertjErrorMessage, actual, caps, actualCaps);
        }

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

}
