All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.tech.apter.junit.jupiter.robolectric.internal.extensions.MethodExtensions.kt Maven / Gradle / Ivy

Go to download

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.

The newest version!
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy