Advertisement
ProgNeo

Untitled

Feb 26th, 2023
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.63 KB | None | 0 0
  1. import org.junit.jupiter.api.Assertions.assertEquals
  2. import org.junit.jupiter.api.Test
  3.  
  4. class MainTests() {
  5.     @Test
  6.     fun testPositive() {
  7.         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)
  8.         val result = posCalc(array)
  9.  
  10.         assertEquals(result, 3.23, 0.01)
  11.     }
  12.  
  13.     @Test
  14.     fun testNegative() {
  15.         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)
  16.         val result = negCalc(array)
  17.  
  18.         assertEquals(result, -3.13, 0.01)
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement