refactor(Programming Basics - Functions - Exercise 1): Function name consistency restored
This commit is contained in:
parent
184b550de0
commit
c3e0ac072b
|
@ -1,8 +1,8 @@
|
||||||
// Functions/Task1.kt
|
// Functions/Task1.kt
|
||||||
package functionsExercise1
|
package functionsExercise1
|
||||||
|
|
||||||
fun getSquare(i: Int): Int = i * i
|
fun squareInt(i: Int): Int = i * i
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
println(getSquare(2)) // 4
|
println(squareInt(2)) // 4
|
||||||
}
|
}
|
|
@ -9,8 +9,8 @@ import util.TIMEOUT
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
class TestFunctionsExercise1 {
|
class TestFunctionsExercise1 {
|
||||||
private fun testFunction(i: Int) {
|
private fun testFunction(i: Int) {
|
||||||
Assert.assertEquals("getSquare($i) should return ${i * i}",
|
Assert.assertEquals("squareInt($i) should return ${i * i}",
|
||||||
i * i, getSquare(i))
|
i * i, squareInt(i))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(timeout = TIMEOUT)
|
@Test(timeout = TIMEOUT)
|
||||||
|
|
Loading…
Reference in New Issue