mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 06:55:02 +08:00
Add a test for average (#3084)
Co-authored-by: thanhtri122002 <thanhnt122002@122002> Co-authored-by: Andrii Siriak <siryaka@gmail.com>
This commit is contained in:
14
src/test/java/com/thealgorithms/maths/AverageTest.java
Normal file
14
src/test/java/com/thealgorithms/maths/AverageTest.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package com.thealgorithms.maths;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
|
||||||
|
public class AverageTest {
|
||||||
|
double [] numbers = {3, 6, 9, 12, 15, 18, 21};
|
||||||
|
@Test
|
||||||
|
public void testAverage() {
|
||||||
|
|
||||||
|
Assertions.assertEquals(12, Average.average(numbers));
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user