// Path: java-schema-sdk/src/main/java/org/openmhealth/schema/domain/omh/TemperatureUnit.java
// public enum TemperatureUnit implements Unit {
// 
//     KELVIN("K"),
//     CELSIUS("C"),
//     FAHRENHEIT("F");
// 
//     private static Map<String, TemperatureUnit> constantsBySchemaValue = Maps.newHashMap();
//     private final String schemaValue;
// 
//     static {
//         for (TemperatureUnit unit : values()) {
//             constantsBySchemaValue.put(unit.getSchemaValue(), unit);
//         }
//     }
// 
//     TemperatureUnit(String schemaValue) {
//         this.schemaValue = schemaValue;
//     }
// 
//     @Override
//     @JsonValue
//     public String getSchemaValue() {
//         return schemaValue;
//     }
// 
//     @Nullable
//     @JsonCreator
//     public static TemperatureUnit findBySchemaValue(String schemaValue) {
//         return constantsBySchemaValue.get(schemaValue);
//     }
// 
//     public TemperatureUnitValue newUnitValue(BigDecimal value) {
//         return new TemperatureUnitValue(this, value);
//     }
// 
//     public TemperatureUnitValue newUnitValue(double value) {
//         return new TemperatureUnitValue(this, value);
//     }
// 
//     public TemperatureUnitValue newUnitValue(long value) {
//         return new TemperatureUnitValue(this, value);
//     }
// }
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());


import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.BodyTemperature.MeasurementLocation.ORAL;
import static org.openmhealth.schema.domain.omh.BodyTemperature.MeasurementLocation.RECTAL;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.TemperatureUnit.*;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
/*
 * Copyright 2015 Open mHealth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openmhealth.schema.domain.omh;





/**
 * @author Chris Schaefbauer
 */
public class BodyTemperatureUnitTests extends SerializationUnitTests {

    public static final String SCHEMA_FILENAME = "schema/omh/body-temperature-1.0.json";

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

    @Test(expectedExceptions = NullPointerException.class)
    public void constructorShouldThrowExceptionWhenBodyTemperatureIsNull() {

        new BodyTemperature.Builder(null).build();
    }

    @Test
    public void buildShouldConstructCorrectMeasureUsingOnlyRequiredProperties() {

        BodyTemperature bodyTemperature = new BodyTemperature.Builder(new TemperatureUnitValue(CELSIUS, 37.3))
                .build();

        assertThat(bodyTemperature.getBodyTemperature(), notNullValue());
        assertThat(bodyTemperature.getBodyTemperature(), equalTo(new TemperatureUnitValue(CELSIUS, 37.3)));

        assertThat(bodyTemperature.getMeasurementLocation(), nullValue());
        assertThat(bodyTemperature.getEffectiveTimeFrame(), nullValue());
        assertThat(bodyTemperature.getDescriptiveStatistic(), nullValue());
        assertThat(bodyTemperature.getUserNotes(), nullValue());
    }

    @Test
    public void buildShouldConstructCorrectMeasureUsingOptionalProperties() {

        BodyTemperature bodyTemperature = new BodyTemperature.Builder(new TemperatureUnitValue(FAHRENHEIT, 99.8))
                .setDescriptiveStatistic(MAXIMUM)
// Path: java-schema-sdk/src/main/java/org/openmhealth/schema/domain/omh/TemperatureUnit.java
// public enum TemperatureUnit implements Unit {
// 
//     KELVIN("K"),
//     CELSIUS("C"),
//     FAHRENHEIT("F");
// 
//     private static Map<String, TemperatureUnit> constantsBySchemaValue = Maps.newHashMap();
//     private final String schemaValue;
// 
//     static {
//         for (TemperatureUnit unit : values()) {
//             constantsBySchemaValue.put(unit.getSchemaValue(), unit);
//         }
//     }
// 
//     TemperatureUnit(String schemaValue) {
//         this.schemaValue = schemaValue;
//     }
// 
//     @Override
//     @JsonValue
//     public String getSchemaValue() {
//         return schemaValue;
//     }
// 
//     @Nullable
//     @JsonCreator
//     public static TemperatureUnit findBySchemaValue(String schemaValue) {
//         return constantsBySchemaValue.get(schemaValue);
//     }
// 
//     public TemperatureUnitValue newUnitValue(BigDecimal value) {
//         return new TemperatureUnitValue(this, value);
//     }
// 
//     public TemperatureUnitValue newUnitValue(double value) {
//         return new TemperatureUnitValue(this, value);
//     }
// 
//     public TemperatureUnitValue newUnitValue(long value) {
//         return new TemperatureUnitValue(this, value);
//     }
// }
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());


// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/BodyTemperatureUnitTests.java
import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.BodyTemperature.MeasurementLocation.ORAL;
import static org.openmhealth.schema.domain.omh.BodyTemperature.MeasurementLocation.RECTAL;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.TemperatureUnit.*;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;

/*
 * Copyright 2015 Open mHealth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openmhealth.schema.domain.omh;





/**
 * @author Chris Schaefbauer
 */
public class BodyTemperatureUnitTests extends SerializationUnitTests {

    public static final String SCHEMA_FILENAME = "schema/omh/body-temperature-1.0.json";

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

    @Test(expectedExceptions = NullPointerException.class)
    public void constructorShouldThrowExceptionWhenBodyTemperatureIsNull() {

        new BodyTemperature.Builder(null).build();
    }

    @Test
    public void buildShouldConstructCorrectMeasureUsingOnlyRequiredProperties() {

        BodyTemperature bodyTemperature = new BodyTemperature.Builder(new TemperatureUnitValue(CELSIUS, 37.3))
                .build();

        assertThat(bodyTemperature.getBodyTemperature(), notNullValue());
        assertThat(bodyTemperature.getBodyTemperature(), equalTo(new TemperatureUnitValue(CELSIUS, 37.3)));

        assertThat(bodyTemperature.getMeasurementLocation(), nullValue());
        assertThat(bodyTemperature.getEffectiveTimeFrame(), nullValue());
        assertThat(bodyTemperature.getDescriptiveStatistic(), nullValue());
        assertThat(bodyTemperature.getUserNotes(), nullValue());
    }

    @Test
    public void buildShouldConstructCorrectMeasureUsingOptionalProperties() {

        BodyTemperature bodyTemperature = new BodyTemperature.Builder(new TemperatureUnitValue(FAHRENHEIT, 99.8))
                .setDescriptiveStatistic(MAXIMUM)
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)