package org.nzbhydra.mapping.newznab.xml;

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

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

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

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

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

        // null safe check
        String actualName = actual.getName();
        if (!Objects.areEqual(actualName, name)) {
            failWithMessage(assertjErrorMessage, actual, name, actualName);
        }

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

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

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

        // null safe check
        String actualValue = actual.getValue();
        if (!Objects.areEqual(actualValue, value)) {
            failWithMessage(assertjErrorMessage, actual, value, actualValue);
        }

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

}
