Package br.com.caelum.tubaina.chunk

Examples of br.com.caelum.tubaina.chunk.ImageChunk


  private static final String END = "\\end{center}\\end{figure}\n\n";
  private static final String BEGIN = "\n\n\\begin{figure}[H]\n\\begin{center}\n";
 
  @Test
  public void testFullImageTag() {
    ImageChunk chunk = makeChunk("image.png", "\"Imagem de alguma coisa\" w=30");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=52.5mm]{image.png}\n" +
        RENEW_COMMAND +
View Full Code Here


        END, result);
  }

  @Test
  public void labelAndNoCaption() throws Exception {
    ImageChunk chunk = makeChunk("image.png", "label=important");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }
 
  @Test
  public void labelNotInformed() throws Exception {
    ImageChunk chunk = makeChunk("image.png", "label=");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }

  @Test
  public void labelNotInformedFollowedByACaption() throws Exception {
    ImageChunk chunk = makeChunk("image.png", "label= \"a caption to the image\"");
    String result = getContent(chunk);
    assertEquals(
            BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        RENEW_COMMAND +
View Full Code Here

        END, result);
  }
 
  @Test
  public void labelAndCaption() throws Exception {
    ImageChunk chunk = makeChunk("image.png", "label=important \"a caption to the image\"");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        RENEW_COMMAND +
View Full Code Here

        END, result);
  }
 
  @Test
  public void testImageTagWithoutBounds() {
    ImageChunk chunk = makeChunk("image.png", "\"Imagem de alguma coisa\"");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        RENEW_COMMAND +
View Full Code Here

        END, result);
  }

  @Test
  public void testImageTagWithoutDesc() {
    ImageChunk chunk = makeChunk("image.png", "w=42");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=73.5mm]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }
 
  @Test
  public void testImageTagWithPercentageSymbol() {
    ImageChunk chunk = makeChunk("image.png", "w=40%");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=70.0mm]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }
 
  @Test
  public void testImageTagWithoutPercentageSymbol() {
    ImageChunk chunk = makeChunk("image.png", "w=40");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=70.0mm]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }
 
  @Test
  public void testImageTagWithInvalidBounds() {
    ImageChunk chunk = makeChunk("image.png", "w=42");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=73.5mm]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.chunk.ImageChunk

Copyright © 2018 www.massapicom. 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.