package com.quicktravel.ticket_printer.ticketfactory;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import static org.junit.Assert.*;

import com.quicktravel.ticket_printer.TicketElement;

public class TicketElementFactoryTest {

  @Test
  public void testMakeTicketElement() {
    Map<String, Object> ticketData = new HashMap<String, Object>();
    ticketData.put("x", 1);
    ticketData.put("y",  2);
    ticketData.put("font_size",  3);
    ticketData.put("bold",  false);
    ticketData.put("italic",  true);
    ticketData.put("value", "the value will have &nbsp; removed");
    
    TicketElement ticketElement = (new TicketElementFactory(ticketData)).makeTicketElement();
    
    assertEquals(ticketElement.getX(), 1);
    assertEquals(ticketElement.getY(), 2);
    assertEquals(ticketElement.getFontSize(), 3);
    assertEquals(ticketElement.isBold(), false);
    assertEquals(ticketElement.isItalic(), true);
    assertEquals(ticketElement.isImage(), false); // Interpreted from value
    assertEquals(ticketElement.getValue(), "the value will have  removed");
  }

}

@@ -59,25 +59,122 @@
 ort 
-java.util.HashMap
+static org.junit.Assert.assertEquals;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List
 ;%0Aim
@@ -229,35 +229,46 @@
 ort 
-static org.junit.Assert.*;%0A
+com.quicktravel.ticket_printer.Ticket;
 %0Aimp
@@ -395,22 +395,19 @@
 keTicket
-Elemen
+Lis
 t() %7B%0A  
@@ -408,16 +408,26 @@
 ) %7B%0A    
+List%3CList%3C
 Map%3CStri
@@ -437,16 +437,18 @@
  Object%3E
+%3E%3E
  ticketD
@@ -454,19 +454,34 @@
 Data
+List
  = new 
-Hash
+ArrayList%3CList%3C
 Map%3C
@@ -495,16 +495,18 @@
  Object%3E
+%3E%3E
 ();%0A    
@@ -519,232 +519,453 @@
 Data
-.put(%22x%22, 1
+List.add(buildListOfTicketElementData()
 );%0A
+%0A
     
-ticketData.put(%22y%22,  2);%0A    ticketData.put(%22font_size%22,  3);%0A    ticketData.put(%22bold%22,  false);%0A    ticketData.put(%22italic%22,  true
+List%3CTicket%3E ticketList = new TicketListFactory(ticketDataList).makeTicketList();%0A    assertEquals(ticketList.size(), 1);%0A  %7D%0A%0A  @Test%0A  public void testMakeTicket() %7B%0A    List%3CMap%3CString, Object%3E%3E list = buildListOfTicketElementData();%0A    Ticket ticket = new TicketFactory(list).makeTicket(
 );%0A
+%0A
     
-ticketData.put(%22value%22, %22the value will have &nbsp; removed%22);%0A    
+assertEquals(ticket.getElements().size(), 1);%0A  %7D%0A%0A  @Test%0A  public void testMakeTicketElement() %7B
 %0A   
@@ -978,16 +978,23 @@
 tElement
+Factory
  ticketE
@@ -1003,12 +1003,18 @@
 ment
+Factory
  = 
-(
 new 
@@ -1038,20 +1038,93 @@
 ory(
-ticke
+%0A        ticketElemen
 tData
+(
 ))
+;%0A    TicketElement ticketElement = ticketElementFactory
 .mak
@@ -1141,20 +1141,16 @@
 ment();%0A
-    
 %0A    ass
@@ -1534,10 +1534,589 @@
 );%0A  %7D%0A%0A
+  private List%3CMap%3CString, Object%3E%3E buildListOfTicketElementData() %7B%0A    List%3CMap%3CString, Object%3E%3E list = new ArrayList%3CMap%3CString, Object%3E%3E();%0A    list.add(ticketElementData());%0A    return list;%0A  %7D%0A%0A  private Map%3CString, Object%3E ticketElementData() %7B%0A    Map%3CString, Object%3E ticketData = new HashMap%3CString, Object%3E();%0A    ticketData.put(%22x%22, 1);%0A    ticketData.put(%22y%22, 2);%0A    ticketData.put(%22font_size%22, 3);%0A    ticketData.put(%22bold%22, false);%0A    ticketData.put(%22italic%22, true);%0A    ticketData.put(%22value%22, %22the value will have &nbsp; removed%22);%0A    return ticketData;%0A  %7D%0A%0A
 %7D%0A

Add additional ticket factory tests