コード例 #1
0
  @Test
  public void asDataPointsShouldReturnSelfReportedAsModalityWhenDataSourceContainsUserInput() {

    List<DataPoint<BodyHeight>> dataPoints = mapper.asDataPoints(singletonList(responseNode));

    assertThat(
        dataPoints.get(1).getHeader().getAcquisitionProvenance().getModality(),
        equalTo(SELF_REPORTED));
  }
コード例 #2
0
  @Test
  public void asDataPointsShouldReturnCorrectDataPointForSingleTimePoint() {

    List<DataPoint<BodyHeight>> dataPoints = mapper.asDataPoints(singletonList(responseNode));
    testGoogleFitDataPoint(
        dataPoints.get(0),
        createFloatingPointTestProperties(
            1.8287990093231201,
            "2015-07-08T03:17:06.030Z",
            null,
            "raw:com.google.height:com.google.android.apps.fitness:user_input"));
  }
コード例 #3
0
  @Test
  public void asDataPointsShouldReturnCorrectDataPointForTimeRange() {

    List<DataPoint<BodyHeight>> dataPoints = mapper.asDataPoints(singletonList(responseNode));
    testGoogleFitDataPoint(
        dataPoints.get(1),
        createFloatingPointTestProperties(
            1.828800082206726,
            "2015-07-08T14:43:57.544Z",
            "2015-07-08T14:43:58.545Z",
            "raw:com.google.height:com.google.android.apps.fitness:user_input"));
  }
コード例 #4
0
  @Test
  public void asDataPointsShouldReturnCorrectNumberOfDataPoints() {

    List<DataPoint<BodyHeight>> dataPoints = mapper.asDataPoints(singletonList(responseNode));
    assertThat(dataPoints.size(), equalTo(2));
  }