ExperimentFilesCrossValidator { void factorsNotMissing() { for (AssayGroup assayGroup: assayGroups.get()) { for (String assayGroupId: assayGroup.assaysAnalyzedForThisDataColumn()) { checkState(!experimentDesign.getFactorValues(assayGroupId).isEmpty(), MessageFormat.format("Factor values for assay id {0} missing from experiment design file!", assayGroupId)); } } } ExperimentFilesCrossValidator(ExperimentConfiguration experimentConfiguration,
                                         ExperimentDesign experimentDesign); void validate();  }
@Test(expected = IllegalStateException.class) public void missingFactorsThrow() { when(experimentDesign.getFactorValues("r2")).thenReturn(ImmutableMap.of()); new ExperimentFilesCrossValidator(experimentConfiguration, experimentDesign).factorsNotMissing(); }
@Test public void presentFactorsPass() { when(experimentDesign.getFactorValues("r1")).thenReturn(ImmutableMap.of("type", "value")); when(experimentDesign.getFactorValues("r2")).thenReturn(ImmutableMap.of("type", "value")); new ExperimentFilesCrossValidator(experimentConfiguration, experimentDesign).factorsNotMissing(); }