Skip to content
Snippets Groups Projects
Commit 8ceadc51 authored by Hwaipy Li's avatar Hwaipy Li
Browse files

add an UnitTest for Histogram

parent 1805ddbd
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
package com.xeiam.xchart; package com.xeiam.xchart;
import static org.fest.assertions.api.Assertions.assertThat; import static org.fest.assertions.api.Assertions.assertThat;
import java.util.Arrays; import java.util.Arrays;
import org.junit.Test; import org.junit.Test;
/** /**
...@@ -39,8 +37,9 @@ public class HistogramTest { ...@@ -39,8 +37,9 @@ public class HistogramTest {
// Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).build(); // Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).build();
// chart.addSeries("histogram 1", histogram.getxAxisData(), histogram.getyAxisData()); // chart.addSeries("histogram 1", histogram.getxAxisData(), histogram.getyAxisData());
// new SwingWrapper(chart).displayChart(); // new SwingWrapper(chart).displayChart();
}
}@Test @Test
public void testNegetiveValues() { public void testNegetiveValues() {
Histogram histogram = new Histogram(Arrays.asList(-1, -2, -3, -4, -5, -6), 3); Histogram histogram = new Histogram(Arrays.asList(-1, -2, -3, -4, -5, -6), 3);
...@@ -49,4 +48,5 @@ public class HistogramTest { ...@@ -49,4 +48,5 @@ public class HistogramTest {
assertThat(histogram.getMin()).isEqualTo(-6); assertThat(histogram.getMin()).isEqualTo(-6);
assertThat(histogram.getNumBins()).isEqualTo(3); assertThat(histogram.getNumBins()).isEqualTo(3);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment