@Test
public void testHealthySeriesCalculator() {
AbstractHealthDescriptor healthDescriptor = createHealthBuilder(true, 0, true, 10, 30);
CategoryBuildResultGraph builder = new HealthGraph(healthDescriptor);
BuildResult result = mock(BuildResult.class);
List<Integer> series;
when(result.getNumberOfAnnotations()).thenReturn(5);
series = builder.computeSeries(result);
assertEquals(WRONG_NUMBER, HEALTHY_SERIES_SIZE, series.size());
assertEquals(WRONG_SERIES_VALUE, 5, (int)series.get(0));
assertEquals(WRONG_SERIES_VALUE, 0, (int)series.get(1));
assertEquals(WRONG_SERIES_VALUE, 0, (int)series.get(2));
when(result.getNumberOfAnnotations()).thenReturn(10);
series = builder.computeSeries(result);
assertEquals(WRONG_NUMBER, HEALTHY_SERIES_SIZE, series.size());
assertEquals(WRONG_SERIES_VALUE, 10, (int)series.get(0));
assertEquals(WRONG_SERIES_VALUE, 0, (int)series.get(1));
assertEquals(WRONG_SERIES_VALUE, 0, (int)series.get(2));
when(result.getNumberOfAnnotations()).thenReturn(11);
series = builder.computeSeries(result);
assertEquals(WRONG_NUMBER, HEALTHY_SERIES_SIZE, series.size());
assertEquals(WRONG_SERIES_VALUE, 10, (int)series.get(0));
assertEquals(WRONG_SERIES_VALUE, 1, (int)series.get(1));
assertEquals(WRONG_SERIES_VALUE, 0, (int)series.get(2));
when(result.getNumberOfAnnotations()).thenReturn(30);
series = builder.computeSeries(result);
assertEquals(WRONG_NUMBER, HEALTHY_SERIES_SIZE, series.size());
assertEquals(WRONG_SERIES_VALUE, 10, (int)series.get(0));
assertEquals(WRONG_SERIES_VALUE, 20, (int)series.get(1));
assertEquals(WRONG_SERIES_VALUE, 0, (int)series.get(2));
when(result.getNumberOfAnnotations()).thenReturn(31);
series = builder.computeSeries(result);
assertEquals(WRONG_NUMBER, HEALTHY_SERIES_SIZE, series.size());
assertEquals(WRONG_SERIES_VALUE, 10, (int)series.get(0));
assertEquals(WRONG_SERIES_VALUE, 20, (int)series.get(1));
assertEquals(WRONG_SERIES_VALUE, 1, (int)series.get(2));