Beispiel #1
0
  @Test
  public void testEquals() {
    PercentType pt1 = new PercentType(new Integer(100));
    PercentType pt2 = new PercentType("100.0");
    PercentType pt3 = new PercentType(0);
    PercentType pt4 = new PercentType(0);

    assertEquals(true, pt1.equals(pt2));
    assertEquals(true, pt3.equals(pt4));
    assertEquals(false, pt3.equals(pt1));
  }
Beispiel #2
0
 public HSBType(DecimalType h, PercentType s, PercentType b) {
   this.hue = h.toBigDecimal();
   this.saturation = s.toBigDecimal();
   this.value = b.toBigDecimal();
 }
Beispiel #3
0
 @Test
 public void IntValue() {
   PercentType pt = new PercentType(100);
   assertEquals("100", pt.toString());
 }
Beispiel #4
0
 @Test
 public void DoubleValue() {
   PercentType pt = new PercentType("0.0001");
   assertEquals("0.0001", pt.toString());
 }