Exemple #1
0
  @Test
  public void averageExpressionLevel() {
    double averageExpressionLevel =
        subject.getAverageExpressionLevelOn(Sets.newHashSet(factor1, factor3));
    assertThat(averageExpressionLevel, is(2.6005000000000003D));

    averageExpressionLevel =
        subject.getAverageExpressionLevelOn(
            Sets.newHashSet(factor1, factor3, new Factor(QUERY_FACTOR_TYPE, "leg")));
    assertThat(averageExpressionLevel, is(1.733666666666667D));
  }
Exemple #2
0
 @Test
 public void averageExpressionLevelOnEmptyCollection() {
   // given
   Set<Factor> queryFactors = Sets.newHashSet(mock(Factor.class));
   // when
   double averageExpressionLevel = subject.getAverageExpressionLevelOn(queryFactors);
   // then
   assertThat(averageExpressionLevel, is(0D));
 }
Exemple #3
0
 @Test(expected = IllegalArgumentException.class)
 public void shouldThrowExceptionWhenQueryFactorsIsEmpty() {
   subject.getAverageExpressionLevelOn(new HashSet<Factor>());
 }