|
@@ -12,6 +12,8 @@ public class ItemParserTest {
|
12
|
12
|
|
13
|
13
|
private String rawSingleItem = "naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##";
|
14
|
14
|
|
|
15
|
+ private String rawSingleItemIrregularSeperatorSample = "naMe:MiLK;price:3.23;type:Food^expiration:1/11/2016##";
|
|
16
|
+
|
15
|
17
|
private String rawBrokenSingleItem = "naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##";
|
16
|
18
|
|
17
|
19
|
private String rawMultipleItems = "naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##"
|
|
@@ -44,4 +46,17 @@ public class ItemParserTest {
|
44
|
46
|
itemParser.parseStringIntoItem(rawBrokenSingleItem);
|
45
|
47
|
}
|
46
|
48
|
|
|
49
|
+ @Test
|
|
50
|
+ public void findKeyValuePairsInRawItemDataTest(){
|
|
51
|
+ Integer expected = 4;
|
|
52
|
+ Integer actual = itemParser.findKeyValuePairsInRawItemData(rawSingleItem).size();
|
|
53
|
+ assertEquals(expected, actual);
|
|
54
|
+ }
|
|
55
|
+
|
|
56
|
+ @Test
|
|
57
|
+ public void findKeyValuePairsInRawItemDataTestIrregular(){
|
|
58
|
+ Integer expected = 4;
|
|
59
|
+ Integer actual = itemParser.findKeyValuePairsInRawItemData(rawSingleItemIrregularSeperatorSample).size();
|
|
60
|
+ assertEquals(expected, actual);
|
|
61
|
+ }
|
47
|
62
|
}
|