Testing frameworks
To finish this book, we will talk about some options that we want to offer as a starting point for anyone who wants to go deeper into testing with Kotlin. In this last part, we will briefly talk about the frameworks that are a viable option for testing, and we will explain the advantages, disadvantages, and scenarios where it is more convenient to use them.
We’ll show a very short implementation of the frameworks that we will mention, and have a quick look at how they work. We will use two tests as a reference.
The tests are to verify the multiplication and divisibility of even numbers. The first test will evaluate whether the multiplication of two numbers (2 * 3) produces the expected result (6). The second test is a parameterized test, meaning it is run multiple times with different values provided in a list ([2, 4, 6]). On each run, it checks whether the given number is a multiple of 2 by checking that its remainder when divided by 2 is 0 (number...