@Test
public void shouldCompareAndSaveVariation() {
Resource dir = new Directory("org/foo");
PastMeasuresLoader pastMeasuresLoader = mock(PastMeasuresLoader.class);
PastSnapshot pastSnapshot1 = new PastSnapshot("days", new Date()).setIndex(1);
PastSnapshot pastSnapshot3 = new PastSnapshot("days", new Date()).setIndex(3);
// first past analysis
when(pastMeasuresLoader.getPastMeasures(dir, pastSnapshot1)).thenReturn(Arrays.asList(
new Object[] {NCLOC_ID, null, null, null, 180.0},
new Object[] {COVERAGE_ID, null, null, null, 75.0}));
// second past analysis
when(pastMeasuresLoader.getPastMeasures(dir, pastSnapshot3)).thenReturn(Arrays.<Object[]>asList(
new Object[] {NCLOC_ID, null, null, null, 240.0}));
// current analysis
DecoratorContext context = mock(DecoratorContext.class);
Measure currentNcloc = newMeasure(NCLOC, 200.0);