BgReading implements DataPointWithLabelInterface { public String directionToSymbol() { String symbol = ""; if (direction == null) direction = calculateDirection(); if (direction.compareTo("DoubleDown") == 0) { symbol = "\u21ca"; } else if (direction.compareTo("SingleDown") == 0) { symbol = "\u2193"; } else if (direction.compareTo("FortyFiveDown") == 0) { symbol = "\u2198"; } else if (direction.compareTo("Flat") == 0) { symbol = "\u2192"; } else if (direction.compareTo("FortyFiveUp") == 0) { symbol = "\u2197"; } else if (direction.compareTo("SingleUp") == 0) { symbol = "\u2191"; } else if (direction.compareTo("DoubleUp") == 0) { symbol = "\u21c8"; } else if (isSlopeNameInvalid(direction)) { symbol = "??"; } return symbol; } BgReading();  BgReading(NSSgv sgv); Double valueToUnits(String units); String valueToUnitsToString(String units); String directionToSymbol(); @Override String toString(); boolean isDataChanging(BgReading other); boolean isEqual(BgReading other); void copyFrom(BgReading other); BgReading date(long date); BgReading date(Date date); BgReading value(double value); @Override double getX(); @Override double getY(); @Override void setY(double y); @Override String getLabel(); @Override long getDuration(); @Override PointsWithLabelGraphSeries.Shape getShape(); @Override float getSize(); @Override int getColor(); int getPredectionColor(); @DatabaseField(id = true)
    public long date; @DatabaseField
    public boolean isValid; @DatabaseField
    public double value; @DatabaseField
    public String direction; @DatabaseField
    public double raw; @DatabaseField
    public int source; @DatabaseField
    public String _id; public boolean isCOBPrediction; public boolean isaCOBPrediction; public boolean isIOBPrediction; public boolean isUAMPrediction; public boolean isZTPrediction; }
@Test public void directionToSymbol() { bgReading = new BgReading(); bgReading.direction = "DoubleDown"; assertEquals("\u21ca", bgReading.directionToSymbol()); bgReading.direction = "SingleDown"; assertEquals("\u2193", bgReading.directionToSymbol()); bgReading.direction = "FortyFiveDown"; assertEquals("\u2198", bgReading.directionToSymbol()); bgReading.direction = "Flat"; assertEquals("\u2192", bgReading.directionToSymbol()); bgReading.direction = "FortyFiveUp"; assertEquals("\u2197", bgReading.directionToSymbol()); bgReading.direction = "SingleUp"; assertEquals("\u2191", bgReading.directionToSymbol()); bgReading.direction = "DoubleUp"; assertEquals("\u21c8", bgReading.directionToSymbol()); bgReading.direction = "OUT OF RANGE"; assertEquals("??", bgReading.directionToSymbol()); }