/*
 * Copyright (c) 2025 Element Creations Ltd.
 * Copyright 2023-2025 New Vector Ltd.
 *
 * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
 * Please see LICENSE files in the repository root for full details.
 */

package id.databisnis.android.bachot.tests.konsist

import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.constructors
import com.lemonappdev.konsist.api.ext.list.withAllParentsOf
import com.lemonappdev.konsist.api.verify.assertTrue
import id.databisnis.android.bachot.libraries.architecture.Presenter
import org.junit.Test

class KonsistPresenterTest {
    @Test
    fun `'Presenter' should not depend on other presenters`() {
        Konsist.scopeFromProject()
            .classes()
            .withAllParentsOf(Presenter::class)
            .constructors
            .assertTrue { constructor ->
                val result = constructor.parameters.none { parameter ->
                    parameter.type.name.endsWith("Presenter")
                }
                result
            }
    }
}
