package com.oguerreiro.resilient.domain;

import static org.assertj.core.api.Assertions.assertThat;

public class VariableScopeAsserts {

    /**
     * Asserts that the entity has all properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertVariableScopeAllPropertiesEquals(VariableScope expected, VariableScope actual) {
        assertVariableScopeAutoGeneratedPropertiesEquals(expected, actual);
        assertVariableScopeAllUpdatablePropertiesEquals(expected, actual);
    }

    /**
     * Asserts that the entity has all updatable properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertVariableScopeAllUpdatablePropertiesEquals(VariableScope expected, VariableScope actual) {
        assertVariableScopeUpdatableFieldsEquals(expected, actual);
        assertVariableScopeUpdatableRelationshipsEquals(expected, actual);
    }

    /**
     * Asserts that the entity has all the auto generated properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertVariableScopeAutoGeneratedPropertiesEquals(VariableScope expected, VariableScope actual) {
        assertThat(expected)
            .as("Verify VariableScope auto generated properties")
            .satisfies(e -> assertThat(e.getId()).as("check id").isEqualTo(actual.getId()));
    }

    /**
     * Asserts that the entity has all the updatable fields set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertVariableScopeUpdatableFieldsEquals(VariableScope expected, VariableScope actual) {
        assertThat(expected)
            .as("Verify VariableScope relevant properties")
            .satisfies(e -> assertThat(e.getCode()).as("check code").isEqualTo(actual.getCode()))
            .satisfies(e -> assertThat(e.getName()).as("check name").isEqualTo(actual.getName()))
            .satisfies(e -> assertThat(e.getDescription()).as("check description").isEqualTo(actual.getDescription()))
            .satisfies(e -> assertThat(e.getVersion()).as("check version").isEqualTo(actual.getVersion()));
    }

    /**
     * Asserts that the entity has all the updatable relationships set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertVariableScopeUpdatableRelationshipsEquals(VariableScope expected, VariableScope actual) {}
}
