package au.com.sealink.printing.ticket_printer;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class TicketElementTest {

  private TicketElement emptyticket;
  private TicketElement imageticket;
  private final String imageString = "image: setupusthebomb";
  private final int imageOffset = 6;

  @Before
  public void setUp() throws Exception {
    emptyticket = new TicketElement();
    imageticket = new TicketElement();
    imageticket.setValue(imageString);
  }

  @Test
  public void testImageElementIsDetectedAsImage() {
    assertTrue(imageticket.isImage());
  }

  @Test
  public void testNonImageElementIsNotDetectedAsImage() {
    assertFalse(emptyticket.isImage());
  }

  @Test
  public void testGetImageElementImageValue() {
    assertEquals(imageString.substring(imageOffset), imageticket.getImageValue());
  }

}

@@ -866,10 +866,774 @@
 );%0A  %7D%0A%0A
+  @Test%0A  public void testBasicGettersAndSetters() %7B%0A    TicketElement element = new TicketElement();%0A    element.setBold(true);%0A    element.setInverted(false);%0A    element.setItalic(true);%0A    element.setJustification(Justification.CENTRE);%0A    element.setX(10);%0A    element.setY(1);%0A    element.setFontSize(10);%0A    element.setHeight(50);%0A    element.setWidth(30);%0A%0A    assertTrue(element.isBold());%0A    assertFalse(element.isInverted());%0A    assertTrue(element.isItalic());%0A    assertEquals(Justification.CENTRE, element.getJustification());%0A    assertEquals(10, element.getX());%0A    assertEquals(1, element.getY());%0A    assertEquals(10, element.getFontSize());%0A    assertEquals(50, (int)element.getHeight());%0A    assertEquals(30, (int)element.getWidth());%0A  %7D%0A
 %7D%0A

Add basic getter / setter tests