// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_DAY =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 21).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, OCTOBER, 22).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));


import org.testng.annotations.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.AVERAGE;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MEDIAN;
import static org.openmhealth.schema.domain.omh.DescriptiveStatisticDenominator.DAY;
import static org.openmhealth.schema.domain.omh.KcalUnit.KILOCALORIE;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_DAY;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
                .setUserNotes("feeling fine")
                .build();

        assertThat(caloriesBurned, notNullValue());
        assertThat(caloriesBurned.getKcalBurned(), equalTo(kcalBurned));
        assertThat(caloriesBurned.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));
        assertThat(caloriesBurned.getActivityName(), equalTo("swimming"));
        assertThat(caloriesBurned.getDescriptiveStatistic(), equalTo(MEDIAN));
        assertThat(caloriesBurned.getDescriptiveStatisticDenominator(), equalTo(DAY));
        assertThat(caloriesBurned.getUserNotes(), equalTo("feeling fine"));
    }

    @Override
    protected String getSchemaFilename() {
        return SCHEMA_FILENAME;
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        CaloriesBurned2 measure = new CaloriesBurned2.Builder(KILOCALORIE.newUnitValue(160), FIXED_MONTH)
                .setActivityName("walking")
                .setDescriptiveStatistic(AVERAGE)
                .setDescriptiveStatisticDenominator(DAY)
                .setUserNotes("feeling fine")
                .build();

        String document = "{\n" +
                "    \"kcal_burned\": {\n" +
                "        \"value\": 160,\n" +
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_DAY =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 21).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, OCTOBER, 22).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));


// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/CaloriesBurned2UnitTests.java
import org.testng.annotations.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.AVERAGE;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MEDIAN;
import static org.openmhealth.schema.domain.omh.DescriptiveStatisticDenominator.DAY;
import static org.openmhealth.schema.domain.omh.KcalUnit.KILOCALORIE;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_DAY;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;

                .setUserNotes("feeling fine")
                .build();

        assertThat(caloriesBurned, notNullValue());
        assertThat(caloriesBurned.getKcalBurned(), equalTo(kcalBurned));
        assertThat(caloriesBurned.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));
        assertThat(caloriesBurned.getActivityName(), equalTo("swimming"));
        assertThat(caloriesBurned.getDescriptiveStatistic(), equalTo(MEDIAN));
        assertThat(caloriesBurned.getDescriptiveStatisticDenominator(), equalTo(DAY));
        assertThat(caloriesBurned.getUserNotes(), equalTo("feeling fine"));
    }

    @Override
    protected String getSchemaFilename() {
        return SCHEMA_FILENAME;
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        CaloriesBurned2 measure = new CaloriesBurned2.Builder(KILOCALORIE.newUnitValue(160), FIXED_MONTH)
                .setActivityName("walking")
                .setDescriptiveStatistic(AVERAGE)
                .setDescriptiveStatisticDenominator(DAY)
                .setUserNotes("feeling fine")
                .build();

        String document = "{\n" +
                "    \"kcal_burned\": {\n" +
                "        \"value\": 160,\n" +
                "        \"unit\": \"kcal\"\n" +