Created
January 12, 2018 18:49
-
-
Save RafaRuiz/da9407e67f26ca33e1637b2132f9c316 to your computer and use it in GitHub Desktop.
RectangleModel Tests Constructor Based
This file contains 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 RectangleModelTestConstructorBased constructor( | |
private val o1: Point, | |
private val o2: Point, | |
private val expected: Boolean) { | |
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