在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mockito/mockito-kotlin开源软件地址(OpenSource Url):https://github.com/mockito/mockito-kotlin开源编程语言(OpenSource Language):Kotlin 99.8%开源软件介绍(OpenSource Introduction):Mockito-KotlinA small library that provides helper functions to work with Mockito in Kotlin. InstallMockito-Kotlin is available on Maven Central.
For Gradle users, add the following to your testImplementation "org.mockito.kotlin:mockito-kotlin:x.x.x" ExampleA test using Mockito-Kotlin typically looks like the following: @Test
fun doAction_doesSomething(){
/* Given */
val mock = mock<MyClass> {
on { getText() } doReturn "text"
}
val classUnderTest = ClassUnderTest(mock)
/* When */
classUnderTest.doAction()
/* Then */
verify(mock).doSomething(any())
} For more info and samples, see the Wiki. BuildingMockito-Kotlin is built with Gradle.
VersioningMockito-Kotlin roughly follows SEMVER TestingMockito-Kotlin's test suite is located in a separate
Usually it is enough to test only using the default Kotlin versions;
CI will test against multiple versions.
If you want to test using a different Kotlin version locally, set
an environment variable Acknowledgements
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论