With that, you can directly see which testcase fails, see for yourself: You may have noticed the name of the test? Well, this little trick makes our test super explicit and easier to debug, see for yourself : add the annotation for the the type of argument source we want to provide ( here) with the related test cases.add the annotation and optionnally define a name,.To be able to use the JUnit5 features, we must first add the dependencies:Įnter fullscreen mode Exit fullscreen mode If you just want to jump in the code, please yourself I'm a java-ist so my go-to test framework is JUnit, this is the sole reason why I'm starting by this one. A comparision of these two testing frameworks (mostly in term of features, usability, readability), this one might be a bit opinionated.Mocking, stubbing and contract testing in Kotlin with JUnit5 and Kotest (upcoming).Basic testing in Kotlin with Kotest built for kotlin specificatlly (upcoming).Basic testing in Kotlin with JUnit5 from the Java ecosystem (this article).To learn further, I've deciced to start a serie of articles on this topic: In the meantime, I've also started to gain a lot of interest on Test Driven Development and found myself wondering "wow, how do I test in Kotlin ? which framework should I use?" I've recently started coding backend and mobile stuff in kotlin, following a book, then starting a pet project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |