Last active
September 28, 2021 09:36
-
-
Save aysesenses/769ee187cffb854ef6598eaedbdbcd35 to your computer and use it in GitHub Desktop.
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
import junit.framework.Assert.assertEquals | |
import org.junit.Before | |
import org.junit.Test | |
class CalculatorTest { | |
private lateinit var calculator: Calculator | |
@Before | |
fun setUp() { | |
calculator = Calculator() | |
} | |
@Test | |
fun sum() { | |
assertEquals(6.0, calculator.sum(1.0, 5.0)) | |
} | |
@Test | |
fun subtract() { | |
assertEquals(6.0, calculator.subtract(10.0, 4.0)) | |
} | |
@Test | |
fun divide() { | |
assertEquals(2.0, calculator.divide(10.0, 5.0)) | |
} | |
@Test | |
fun multiply() { | |
assertEquals(20.0,calculator.multiply(2.0,10.0)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment