  @Test
  public void testGetValueWithUnit ()
  {

    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.PERCENTAGE), CSSNumberHelper.getValueWithUnit ("50%", true));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.LENGTH_MM), CSSNumberHelper.getValueWithUnit ("50mm", true));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.LENGTH_CM), CSSNumberHelper.getValueWithUnit ("50cm", true));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.EX), CSSNumberHelper.getValueWithUnit ("50ex", true));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.EX), CSSNumberHelper.getValueWithUnit (" 50ex ", true));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.EX), CSSNumberHelper.getValueWithUnit (" 50ex ", false));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.EX), CSSNumberHelper.getValueWithUnit (" 50 ex ", false));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.EX), CSSNumberHelper.getValueWithUnit ("    50      ex     ", false));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.TIME_S), CSSNumberHelper.getValueWithUnit (" 50 s ", false));
    assertEquals (new CSSSimpleValueWithUnit (50, ECSSUnit.TIME_MS), CSSNumberHelper.getValueWithUnit (" 50 ms ", false));

    assertNull (CSSNumberHelper.getValueWithUnit (" 50 xs ", false));
    assertNull (CSSNumberHelper.getValueWithUnit ("50%", false));
    assertNull (CSSNumberHelper.getValueWithUnit ("", false));
    assertNull (CSSNumberHelper.getValueWithUnit ("", true));
    assertNull (CSSNumberHelper.getValueWithUnit (" ", false));
    assertNull (CSSNumberHelper.getValueWithUnit (" ", true));
    assertNull (CSSNumberHelper.getValueWithUnit (" mm ", true));
    assertNull (CSSNumberHelper.getValueWithUnit (" % ", true));
    assertNull (CSSNumberHelper.getValueWithUnit (" 50 xyz ", true));
    assertNull (CSSNumberHelper.getValueWithUnit (" 50 gd ", true));
    assertNull (CSSNumberHelper.getValueWithUnit ("50gd", true));
  }