Package com.base2art.jeqll.projections

Examples of com.base2art.jeqll.projections.DoubleField


  @Test
  public void shouldGetMinAndMax()
  {
    IQuery<WeatherObservation> query = new IterableQuery<>(SampleDataRepository.weatherObservations(), WeatherObservation.class);
    assertThat(query.max(new DoubleField("temp"))).isEqualTo(100.6);
    assertThat(query.min(new DoubleField("temp"))).isEqualTo(43.6);
  }
View Full Code Here


  @Test
  public void shouldGetAverageAndSum()
  {
    IQuery<WeatherObservation> query = new IterableQuery<>(SampleDataRepository.weatherObservations(), WeatherObservation.class);
    double actualSum = 43.6 + 44.6 + 45.6 + 46.6 + 47.6 + 100.6;
    assertThat(query.sum(new DoubleField("temp"))).isEqualTo(actualSum);
    assertThat(query.average(new DoubleField("temp"))).isEqualTo(actualSum / 6);
  }
View Full Code Here

TOP

Related Classes of com.base2art.jeqll.projections.DoubleField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.