Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be auto-generated
This commit is contained in:
committed by
Alexander Udalov
parent
ecbb2f10ef
commit
41a416da60
@@ -0,0 +1,34 @@
|
||||
package test
|
||||
|
||||
trait TextField {
|
||||
fun getText(): String
|
||||
}
|
||||
|
||||
trait InputTextField : TextField {
|
||||
fun setText(text: String)
|
||||
}
|
||||
|
||||
trait MooableTextField : InputTextField {
|
||||
fun moo(a: Int, b: Int, c: Int): Int
|
||||
}
|
||||
|
||||
class SimpleTextField : MooableTextField {
|
||||
private var text = ""
|
||||
override fun getText() = text
|
||||
override fun setText(text: String) {
|
||||
this.text = text
|
||||
}
|
||||
override fun moo(a: Int, b: Int, c: Int) = a + b + c
|
||||
}
|
||||
|
||||
class TextFieldWrapper(textField: MooableTextField) : MooableTextField by textField
|
||||
|
||||
fun box() : String {
|
||||
val textField = TextFieldWrapper(SimpleTextField())
|
||||
textField.setText("hello world!")
|
||||
|
||||
if (!textField.getText().equals("hello world!")) return "FAIL #!1"
|
||||
if (textField.moo(1,2,3) != 6) return "FAIL #2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user