Created
September 28, 2021 11:51
-
-
Save aysesenses/a5ece10721f14aac1baa67f4e5ccf410 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 `the expected value in addition is equal to the true value`() { | |
assertEquals(6.0, calculator.sum(1.0, 5.0)) | |
} | |
@Test | |
fun `the expected value in subtraction is equal to the true value`() { | |
assertEquals(6.0, calculator.subtract(10.0, 4.0)) | |
} | |
@Test | |
fun `the expected value in division is equal to the true value`() { | |
assertEquals(2.0, calculator.divide(10.0, 5.0)) | |
} | |
@Test | |
fun `the expected value in multiplication is equal to the true value` () { | |
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