// 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 java.math.BigDecimal;
import static java.math.BigDecimal.ONE;
import static java.math.BigDecimal.TEN;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.DurationUnit.HOUR;
import static org.openmhealth.schema.domain.omh.DurationUnit.WEEK;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_DAY;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
        new SleepDuration1.Builder(new DurationUnitValue(WEEK, ONE));
    }

    @Test
    public void buildShouldConstructMeasureUsingOnlyRequiredProperties() {

        DurationUnitValue durationUnitValue = new DurationUnitValue(HOUR, TEN);

        SleepDuration1 sleepDuration = new SleepDuration1.Builder(durationUnitValue).build();

        assertThat(sleepDuration, notNullValue());
        assertThat(sleepDuration.getSleepDuration(), equalTo(durationUnitValue));
        assertThat(sleepDuration.getEffectiveTimeFrame(), nullValue());
        assertThat(sleepDuration.getDescriptiveStatistic(), nullValue());
        assertThat(sleepDuration.getUserNotes(), nullValue());
    }

    @Test
    public void buildShouldConstructMeasureUsingOptionalProperties() {

        DurationUnitValue durationUnitValue = new DurationUnitValue(HOUR, TEN);

        SleepDuration1 sleepDuration = new SleepDuration1.Builder(durationUnitValue)
                .setEffectiveTimeFrame(FIXED_MONTH)
                .setDescriptiveStatistic(MAXIMUM)
                .setUserNotes("feeling fine")
                .build();

        assertThat(sleepDuration, notNullValue());
        assertThat(sleepDuration.getSleepDuration(), equalTo(durationUnitValue));
// 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/SleepDuration1UnitTests.java
import org.testng.annotations.Test;
import java.math.BigDecimal;
import static java.math.BigDecimal.ONE;
import static java.math.BigDecimal.TEN;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.DurationUnit.HOUR;
import static org.openmhealth.schema.domain.omh.DurationUnit.WEEK;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_DAY;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;

        new SleepDuration1.Builder(new DurationUnitValue(WEEK, ONE));
    }

    @Test
    public void buildShouldConstructMeasureUsingOnlyRequiredProperties() {

        DurationUnitValue durationUnitValue = new DurationUnitValue(HOUR, TEN);

        SleepDuration1 sleepDuration = new SleepDuration1.Builder(durationUnitValue).build();

        assertThat(sleepDuration, notNullValue());
        assertThat(sleepDuration.getSleepDuration(), equalTo(durationUnitValue));
        assertThat(sleepDuration.getEffectiveTimeFrame(), nullValue());
        assertThat(sleepDuration.getDescriptiveStatistic(), nullValue());
        assertThat(sleepDuration.getUserNotes(), nullValue());
    }

    @Test
    public void buildShouldConstructMeasureUsingOptionalProperties() {

        DurationUnitValue durationUnitValue = new DurationUnitValue(HOUR, TEN);

        SleepDuration1 sleepDuration = new SleepDuration1.Builder(durationUnitValue)
                .setEffectiveTimeFrame(FIXED_MONTH)
                .setDescriptiveStatistic(MAXIMUM)
                .setUserNotes("feeling fine")
                .build();

        assertThat(sleepDuration, notNullValue());
        assertThat(sleepDuration.getSleepDuration(), equalTo(durationUnitValue));
        assertThat(sleepDuration.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));