main.tech.apter.junit.jupiter.robolectric.internal.extensions.MethodExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robolectric-extension Show documentation
Show all versions of robolectric-extension Show documentation
This repository aims to bridge the gap between JUnit 5 and Robolectric,
enabling developers to leverage the benefits of both frameworks
for unit testing Android applications. While Robolectric currently lacks
a dedicated JUnit 5 extension, this project proposes a community-driven solution to
achieve seamless integration.
package tech.apter.junit.jupiter.robolectric.internal.extensions
import java.lang.reflect.Method
@Suppress("ReturnCount")
internal fun Method.hasTheSameParameterTypes(method: Method): Boolean {
if (parameterTypes.size != method.parameterTypes.size) {
return false
}
for (i in parameterTypes.indices) {
val clazz1 = parameterTypes[i]
val clazz2 = method.parameterTypes[i]
if (clazz1.name != clazz2.name) {
return false
}
}
return true
}