basics

Testing time-based code with Joda Time

In some systems you sometimes need to record date or timestamp of given action. Good example could be comments system, where each comment has timestamp: interface CommentsInteractor { fun createComment(content: String): CommentEntity}data class CommentEntity( val content: String, val timestamp: Long) In our experiment we will perform two test cases: comment created at given time should …

Testing time-based code with Joda Time Read More »

Parameterized tests with Kotest

We make use of parameterized test when we want to check system under test against various inputs while using same or similar test logic. Real life example for parameterized test may be unit conversion – meters to kilometers converter for the sake of UI display. In some place in an application (either web or mobile) …

Parameterized tests with Kotest Read More »

Test execution basics: passed, failed, crashed

In Junit based testing framework there are few possible test outcomes: passed, failed and crashed. In this short note we will dive into that mechanisms. Test will pass, if no exception is thrown. Empty test should always pass: class TestFlowShowcase : StringSpec({ "it should pass"{ // nothing here }}) Or test with assertion that passes: …

Test execution basics: passed, failed, crashed Read More »