// Path: app/src/main/java/com/waynedgrant/cirrus/measures/Pressure.java
// public class Pressure {
//     private BigDecimal hectopascals;
//     private BigDecimal millibars;
//     private BigDecimal kilopascals;
//     private BigDecimal inchesOfMercury;
//     private BigDecimal millimetresOfMercury;
// 
//     public Pressure(BigDecimal hectopascals) {
//         this.hectopascals = hectopascals;
//         this.millibars = hectopascals;
//         this.kilopascals = hectopascals.divide(new BigDecimal("10"), DECIMAL32);
//         this.inchesOfMercury = hectopascals.multiply(new BigDecimal("0.02953"), DECIMAL32);
//         this.millimetresOfMercury = hectopascals.multiply(new BigDecimal("0.750062"), DECIMAL32);
//     }
// 
//     public BigDecimal getValue(PressureUnit unit) {
//         BigDecimal value = null;
// 
//         switch (unit) {
//             case HECTOPASCALS:
//                 value = hectopascals;
//                 break;
//             case MILLIBARS:
//                 value = millibars;
//                 break;
//             case KILIOPASCALS:
//                 value = kilopascals;
//                 break;
//             case INCHES_OF_MERCURY:
//                 value = inchesOfMercury;
//                 break;
//             case MILLIMETRES_OF_MERCURY:
//                 value = millimetresOfMercury;
//                 break;
//         }
// 
//         return value;
//     }
// }
// 
// Path: app/src/main/java/com/waynedgrant/cirrus/units/PressureUnit.java
// public enum PressureUnit {
//     HECTOPASCALS("Hectopascals (hPa)"),
//     INCHES_OF_MERCURY("Inches of Mercury (inHg)"),
//     KILIOPASCALS("Kilopascals (kPa)"),
//     MILLIBARS("Millibars (mb)"),
//     MILLIMETRES_OF_MERCURY("Millimetres of Mercury (mmHg)");
// 
//     private String description;
// 
//     PressureUnit(String description) {
//         this.description = description;
//     }
// 
//     public String toString() {
//         return description;
//     }
// }


import com.waynedgrant.cirrus.measures.Pressure;
import com.waynedgrant.cirrus.units.PressureUnit;
import org.junit.Test;
import java.math.BigDecimal;
import static junit.framework.Assert.assertEquals;
package com.waynedgrant.cirrus.presentation.formatters;





public class TestPressureFormatter {
    private PressureFormatter testee;

    @Test
    public void GIVEN_null_pressure_WHEN_hectopascals_formatting_requested_THEN_returns_blank_hectopascals_value() {
        testee = new PressureFormatter(null);
        assertEquals("----.- hPa", testee.format(PressureUnit.HECTOPASCALS));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_millibars_formatting_requested_THEN_returns_blank_millibars_value() {
        testee = new PressureFormatter(null);
        assertEquals("----.- mb", testee.format(PressureUnit.MILLIBARS));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_kilopascals_formatting_requested_THEN_returns_blank_kilopascals_value() {
        testee = new PressureFormatter(null);
        assertEquals("---.-- kPa", testee.format(PressureUnit.KILIOPASCALS));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_inches_of_mercury_formatting_requested_THEN_returns_blank_inches_of_mercury_value() {
        testee = new PressureFormatter(null);
        assertEquals("--.-- inHg", testee.format(PressureUnit.INCHES_OF_MERCURY));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_millimetres_of_mercury_formatting_requested_THEN_returns_blank_millimetres_of_mercury_value() {
        testee = new PressureFormatter(null);
        assertEquals("---.- mmHg", testee.format(PressureUnit.MILLIMETRES_OF_MERCURY));
    }

    @Test
    public void GIVEN_non_null_pressure_WHEN_hectopascals_formatting_requested_THEN_returns_hectopascals_value_to_one_digit() {
// Path: app/src/main/java/com/waynedgrant/cirrus/measures/Pressure.java
// public class Pressure {
//     private BigDecimal hectopascals;
//     private BigDecimal millibars;
//     private BigDecimal kilopascals;
//     private BigDecimal inchesOfMercury;
//     private BigDecimal millimetresOfMercury;
// 
//     public Pressure(BigDecimal hectopascals) {
//         this.hectopascals = hectopascals;
//         this.millibars = hectopascals;
//         this.kilopascals = hectopascals.divide(new BigDecimal("10"), DECIMAL32);
//         this.inchesOfMercury = hectopascals.multiply(new BigDecimal("0.02953"), DECIMAL32);
//         this.millimetresOfMercury = hectopascals.multiply(new BigDecimal("0.750062"), DECIMAL32);
//     }
// 
//     public BigDecimal getValue(PressureUnit unit) {
//         BigDecimal value = null;
// 
//         switch (unit) {
//             case HECTOPASCALS:
//                 value = hectopascals;
//                 break;
//             case MILLIBARS:
//                 value = millibars;
//                 break;
//             case KILIOPASCALS:
//                 value = kilopascals;
//                 break;
//             case INCHES_OF_MERCURY:
//                 value = inchesOfMercury;
//                 break;
//             case MILLIMETRES_OF_MERCURY:
//                 value = millimetresOfMercury;
//                 break;
//         }
// 
//         return value;
//     }
// }
// 
// Path: app/src/main/java/com/waynedgrant/cirrus/units/PressureUnit.java
// public enum PressureUnit {
//     HECTOPASCALS("Hectopascals (hPa)"),
//     INCHES_OF_MERCURY("Inches of Mercury (inHg)"),
//     KILIOPASCALS("Kilopascals (kPa)"),
//     MILLIBARS("Millibars (mb)"),
//     MILLIMETRES_OF_MERCURY("Millimetres of Mercury (mmHg)");
// 
//     private String description;
// 
//     PressureUnit(String description) {
//         this.description = description;
//     }
// 
//     public String toString() {
//         return description;
//     }
// }


// Path: app/src/test/java/com/waynedgrant/cirrus/presentation/formatters/TestPressureFormatter.java
import com.waynedgrant.cirrus.measures.Pressure;
import com.waynedgrant.cirrus.units.PressureUnit;
import org.junit.Test;
import java.math.BigDecimal;
import static junit.framework.Assert.assertEquals;

package com.waynedgrant.cirrus.presentation.formatters;





public class TestPressureFormatter {
    private PressureFormatter testee;

    @Test
    public void GIVEN_null_pressure_WHEN_hectopascals_formatting_requested_THEN_returns_blank_hectopascals_value() {
        testee = new PressureFormatter(null);
        assertEquals("----.- hPa", testee.format(PressureUnit.HECTOPASCALS));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_millibars_formatting_requested_THEN_returns_blank_millibars_value() {
        testee = new PressureFormatter(null);
        assertEquals("----.- mb", testee.format(PressureUnit.MILLIBARS));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_kilopascals_formatting_requested_THEN_returns_blank_kilopascals_value() {
        testee = new PressureFormatter(null);
        assertEquals("---.-- kPa", testee.format(PressureUnit.KILIOPASCALS));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_inches_of_mercury_formatting_requested_THEN_returns_blank_inches_of_mercury_value() {
        testee = new PressureFormatter(null);
        assertEquals("--.-- inHg", testee.format(PressureUnit.INCHES_OF_MERCURY));
    }

    @Test
    public void GIVEN_null_pressure_WHEN_millimetres_of_mercury_formatting_requested_THEN_returns_blank_millimetres_of_mercury_value() {
        testee = new PressureFormatter(null);
        assertEquals("---.- mmHg", testee.format(PressureUnit.MILLIMETRES_OF_MERCURY));
    }

    @Test
    public void GIVEN_non_null_pressure_WHEN_hectopascals_formatting_requested_THEN_returns_hectopascals_value_to_one_digit() {
        testee = new PressureFormatter(new Pressure(new BigDecimal("1015.66")));