Create Fake classes in test modules

This commit is contained in:
Benoit Marty
2025-10-30 18:32:31 +01:00
parent fd6493bf4e
commit 6298209ad9
62 changed files with 798 additions and 327 deletions
@@ -0,0 +1,20 @@
/*
* Copyright 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.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.features.verifysession.test"
}
dependencies {
implementation(projects.features.verifysession.api)
implementation(projects.libraries.architecture)
implementation(projects.tests.testutils)
}
@@ -0,0 +1,22 @@
/*
* Copyright 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 io.element.android.features.verifysession.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.verifysession.api.IncomingVerificationEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeIncomingVerificationEntryPoint : IncomingVerificationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: IncomingVerificationEntryPoint.Params,
callback: IncomingVerificationEntryPoint.Callback,
): Node = lambdaError()
}
@@ -0,0 +1,22 @@
/*
* Copyright 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 io.element.android.features.verifysession.test
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import io.element.android.features.verifysession.api.OutgoingVerificationEntryPoint
import io.element.android.tests.testutils.lambda.lambdaError
class FakeOutgoingVerificationEntryPoint : OutgoingVerificationEntryPoint {
context(parentNode: Node)
override fun createNode(
buildContext: BuildContext,
params: OutgoingVerificationEntryPoint.Params,
callback: OutgoingVerificationEntryPoint.Callback,
): Node = lambdaError()
}