с#
Size: a a a
с#
AM
L
fun `The square of a number should be equal to that number multiplied in itself`() {
Assertions.assertAll(
Executable { Assertions.assertEquals(1, calculator.square(1)) },
Executable { Assertions.assertEquals(4, calculator.square(2)) },
Executable { Assertions.assertEquals(9, calculator.square(3)) }
)
}
AN
fun `The square of a number should be equal to that number multiplied in itself`() {
Assertions.assertAll(
Executable { Assertions.assertEquals(1, calculator.square(1)) },
Executable { Assertions.assertEquals(4, calculator.square(2)) },
Executable { Assertions.assertEquals(9, calculator.square(3)) }
)
}
с#
AN
VP
L
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.10"
testImplementation 'com.github.hyperskill:hs-test:release-SNAPSHOT'
testImplementation(platform("org.junit:junit-bom:5.7.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
sourceSets {
main.java.srcDir 'src'
test.java.srcDir 'test'
}
test {
useJUnitPlatform()
с#
IP
IP
АГ
IP
АГ
IP
АГ
IP
AN
ВМ
interface A {
fun f(x: A): A
}
class B: A {
override fun f(x: B): B
}
fun useCase(b: B, x: B): B = b.f(x) // as B
IP
interface A {
fun f(x: A): A
}
class B: A {
override fun f(x: B): B
}
fun useCase(b: B, x: B): B = b.f(x) // as B