1
1
Fork 0

refactor(Programming Basics - Functions - Exercise 1): Function name consistency restored

This commit is contained in:
Igor 2021-05-20 12:30:14 +03:00
parent 184b550de0
commit c3e0ac072b
2 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
// Functions/Task1.kt
package functionsExercise1
fun getSquare(i: Int): Int = i * i
fun squareInt(i: Int): Int = i * i
fun main() {
println(getSquare(2)) // 4
println(squareInt(2)) // 4
}

View File

@ -9,8 +9,8 @@ import util.TIMEOUT
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
class TestFunctionsExercise1 {
private fun testFunction(i: Int) {
Assert.assertEquals("getSquare($i) should return ${i * i}",
i * i, getSquare(i))
Assert.assertEquals("squareInt($i) should return ${i * i}",
i * i, squareInt(i))
}
@Test(timeout = TIMEOUT)