Created
January 12, 2018 18:53
-
-
Save RafaRuiz/86673226f30605bf2ed1ced979355bb9 to your computer and use it in GitHub Desktop.
RectangleModel Tests Weak Accesses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Parameterized::class) | |
class RectangleModelTestWeakAccesses { | |
@JvmField | |
@Parameterized.Parameter(0) | |
var o1: Point? = null | |
@JvmField | |
@Parameterized.Parameter(1) | |
var o2: Point? = null | |
@JvmField | |
@Parameterized.Parameter(2) | |
var expected: Boolean = false | |
companion object { | |
@JvmStatic | |
@Parameterized.Parameters | |
fun data(): MutableList<Array<out Any?>>? { | |
return Arrays.asList( | |
arrayOf( | |
Point(0, 0), | |
Point(0, 0), | |
false), | |
arrayOf( | |
Point(0, 0), | |
Point(1, 1), | |
true), | |
arrayOf( | |
Point(0, 0), | |
Point(0, 1), | |
false), | |
arrayOf( | |
Point(0, 0), | |
Point(1, 0), | |
false), | |
arrayOf( | |
Point(0, 1), | |
Point(2, 2), | |
true) | |
) | |
} | |
} | |
@Test | |
fun isRectangleWellFormulated() { | |
val isWellFormulated = o2!!.x > o1!!.x && o2!!.y > o1!!.y | |
Assert.assertEquals(isWellFormulated, expected) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment