This repository contains a framework for creating tests in Kotlin.
Currently, this framework is used in the Kotlin Onboarding courses (see the Marketplace)
to test student solutions. It contains functionality to test student solutions
by using the Java Reflection API under the hood.
The proposed wrappers allow us to check the necessary Kotlin properties,
such as val
and var
modifiers or whether the class is a data class for any Java objects.
You can find several usage examples in the test folder.
The project uses Java 11.
Add the following dependency into the Gradle.kts
file:
repositories {
maven("https://packages.jetbrains.team/maven/p/kotlin-test-framework/kotlin-test-framework")
}
dependencies {
implementation("org.jetbrains.academy.test.system:<module-name>:$latest_version")
}
- Clone this repository:
git clone https://github.com/jetbrains-academy/kotlin-test-framework.git
- Build the project:
./gradlew build
To run tests locally, you just need to build the project and run the following command:
./gradlew test
If you have questions about the framework or if you find some errors, you can ask questions and participate in discussions in repository issues.
Please be sure to review the project's contributing guidelines to learn how to help the project.