Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.jupiter.api.Assertions.assertEquals
- import org.junit.jupiter.api.Test
- class MainTests() {
- @Test
- fun testPositive() {
- val array = arrayOf(-3.37, -4.28, 1.11, -0.38, -0.72, 5.36, -8.03, -2.04, -3.37, -4.28, 1.11, -0.38, -0.72, 5.36, -8.03, -2.04)
- val result = posCalc(array)
- assertEquals(result, 3.23, 0.01)
- }
- @Test
- fun testNegative() {
- val array = arrayOf(-3.37, -4.28, 1.11, -0.38, -0.72, 5.36, -8.03, -2.04, -3.37, -4.28, 1.11, -0.38, -0.72, 5.36, -8.03, -2.04)
- val result = negCalc(array)
- assertEquals(result, -3.13, 0.01)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement