Package test.svg

Source Code of test.svg.TestSVGLength

package test.svg;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import net.sf.latexdraw.parsers.svg.parsers.SVGLength;
import net.sf.latexdraw.parsers.svg.parsers.SVGLength.LengthType;

import org.junit.Test;

public class TestSVGLength {
  @SuppressWarnings("unused")
  @Test
  public void testConsctrutor() {
    try {
      new SVGLength(1, null, "1"); //$NON-NLS-1$
      fail();
    }
    catch(IllegalArgumentException e){ /* */ }

    try {
      new SVGLength(1, LengthType.CM, null);
      fail();
    }
    catch(IllegalArgumentException e){ /* */ }
  }


  @Test
  public void testGetters() {
    SVGLength l = new SVGLength(1, LengthType.MM, "1"); //$NON-NLS-1$

    assertEquals(l.getValue(), 1., 0.1);
    assertEquals(l.getLengthType(), LengthType.MM);
    assertEquals(l.getValueAsString(), "1"); //$NON-NLS-1$
  }
}
TOP

Related Classes of test.svg.TestSVGLength

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.