ExampleUnitTest.kt first Idea of unit test for to be created class.
This commit is contained in:
@@ -9,9 +9,21 @@ import org.junit.Assert.*
|
|||||||
*
|
*
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
* See [testing documentation](http://d.android.com/tools/testing).
|
||||||
*/
|
*/
|
||||||
class ExampleUnitTest {
|
class RoundUnitTest {
|
||||||
@Test
|
@Test
|
||||||
fun addition_isCorrect() {
|
fun addition_isCorrect() {
|
||||||
assertEquals(4, 2 + 2)
|
var inputScoreA: Int
|
||||||
|
var inputScoreB: Int
|
||||||
|
|
||||||
|
inputScoreA = 125
|
||||||
|
inputScoreB = -25
|
||||||
|
|
||||||
|
while(inputScoreA <= -25){
|
||||||
|
assertEquals(inputScoreB, Round(inputScoreA, true).scoreB)
|
||||||
|
assertEquals(inputScoreB, Round(inputScoreA, false).scoreA)
|
||||||
|
|
||||||
|
inputScoreA -= 5
|
||||||
|
inputScoreB += 5
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user