Gitlab service upgraded. Please report any problems to dl_gitadmin@cs.lth.se

Commit ee9dbee0 authored by Noric Couderc's avatar Noric Couderc

Moved test to more relevant file

parent 342a0fe5
......@@ -201,22 +201,6 @@ public class ApplicationTest {
}
}
@Test
public void TestMedian() {
List<Double> values = new ArrayList<>();
for (Integer i = 0; i < 10; ++i) {
values.add(i.doubleValue());
}
Assert.assertEquals(4.5, UtilsKt.median(values), 0.001);
List<Double> values1 = new ArrayList<>();
values1.add(1.0);
values1.add(4.0);
values1.add(5.0);
values1.add(3.0);
Assert.assertEquals(3.5, UtilsKt.median(values1), 0.0001);
}
@Test
public void testHistogram2() {
for (int seed = 0; seed < 100; seed++) {
......
import org.junit.Assert
import org.junit.Test
import se.lth.cs.median
import java.util.ArrayList
class UtilsTest {
@Test
fun TestMedian() {
val values = ArrayList<Double>()
for (i in 0..9) {
values.add(i.toDouble())
}
Assert.assertEquals(4.5, median(values), 0.001)
val values1 = ArrayList<Double>()
values1.add(1.0)
values1.add(4.0)
values1.add(5.0)
values1.add(3.0)
Assert.assertEquals(3.5, median(values1), 0.0001)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment