summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-03-25 18:36:58 +0100
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-03-25 18:36:58 +0100
commitfa78c454cc6c9045a539c2518a25adde00eee27a (patch)
treecafd23ff62d39812466f1751af006d010548eca8 /src
parent- additional test tickets (diff)
downloadUIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.tar
UIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.tar.gz
UIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.tar.bz2
UIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.tar.lz
UIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.tar.xz
UIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.tar.zst
UIC-barcode-fa78c454cc6c9045a539c2518a25adde00eee27a.zip
Diffstat (limited to 'src')
-rw-r--r--src/org/uic/barcode/test/TicketLayoutTest.java27
-rw-r--r--src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java15
2 files changed, 42 insertions, 0 deletions
diff --git a/src/org/uic/barcode/test/TicketLayoutTest.java b/src/org/uic/barcode/test/TicketLayoutTest.java
index 089c87d..3d053e7 100644
--- a/src/org/uic/barcode/test/TicketLayoutTest.java
+++ b/src/org/uic/barcode/test/TicketLayoutTest.java
@@ -6,6 +6,7 @@ import java.io.IOException;
import org.junit.Test;
import org.uic.barcode.staticFrame.UTLAYDataRecord;
+import org.uic.barcode.staticFrame.ticketLayoutBarcode.LayoutElement;
import org.uic.barcode.staticFrame.ticketLayoutBarcode.TicketLayout;
import org.uic.barcode.test.utils.SimpleTestTicketLayout;
import org.uic.barcode.test.utils.TestUtils;
@@ -40,6 +41,32 @@ public class TicketLayoutTest {
assertEquals(tl1.toString(),tl2.toString());
+ compare(layout, tl2.getLayout());
+
+ }
+
+ public static void compare(TicketLayout layout1, TicketLayout layout2) {
+
+ assert(layout1.getLayoutStandard().equals(layout2.getLayoutStandard()));
+
+ for (LayoutElement e1: layout1.getElements() ) {
+
+ for (LayoutElement e2 :layout2.getElements()) {
+
+ boolean found = false;
+ if (e1.getLine() == e2.getLine() && e1.getColumn() == e2.getColumn()) {
+ found = true;
+ assert(e1.getText().equals(e2.getText()));
+ }
+ assert(found == true);
+
+ }
+
+ }
+
}
+
+
+
}
diff --git a/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java b/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java
index b1b6422..7b9ae1b 100644
--- a/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java
+++ b/src/org/uic/barcode/test/utils/SimpleTestTicketLayout.java
@@ -28,6 +28,21 @@ public class SimpleTestTicketLayout {
assert(layout1.getLayoutStandard().equals(layout2.getLayoutStandard()));
+ for (LayoutElement e1: layout1.getElements() ) {
+
+ for (LayoutElement e2 :layout2.getElements()) {
+
+ boolean found = false;
+ if (e1.getLine() == e2.getLine() && e1.getColumn() == e2.getColumn()) {
+ found = true;
+ assert(e1.getText().equals(e2.getText()));
+ }
+ assert(found == true);
+
+ }
+
+ }
+
}
}