瀏覽代碼

Showing differences between output and

PeterMcCormick 6 年之前
父節點
當前提交
a64977e721
共有 2 個檔案被更改,包括 24 行新增29 行删除
  1. 0
    29
      src/main/java/io/zipcoder/ItemParser.java
  2. 24
    0
      src/test/java/io/zipcoder/MainTest.java

+ 0
- 29
src/main/java/io/zipcoder/ItemParser.java 查看文件

@@ -126,36 +126,7 @@ public class ItemParser {
126 126
         }
127 127
         return priceOccurrence;
128 128
     }
129
-
130 129
     public HashMap<String, ArrayList<Double>> getNamePrice() {
131 130
         return namePrice;
132 131
     }
133
-
134
-
135
-   public static void main(String[] args) {
136
-       ItemParser itemParser = new ItemParser();
137
-       System.out.println(itemParser.getExceptionsThrown());
138
-   }
139
-//        HashMap<String, ArrayList<Double>> map = new HashMap<>();
140
-//        String item = "Milk";
141
-//        ArrayList<Double> prices = new ArrayList<>();
142
-//
143
-//        Double one = 2.15;
144
-//        Double two = 3.15;
145
-//        Double three = 3.21;
146
-//        Double four = 2.45;
147
-//
148
-//        prices.add(one);
149
-//        prices.add(two);
150
-//        prices.add(three);
151
-//        prices.add(four);
152
-//
153
-//        map.put(item, prices);
154
-//        ItemParser itemParser = new ItemParser();
155
-//
156
-//        System.out.println(itemParser.getPriceOccurrence(map, item));
157
-//
158
-//    }
159
-
160
-
161 132
 }

+ 24
- 0
src/test/java/io/zipcoder/MainTest.java 查看文件

@@ -99,6 +99,29 @@ public class MainTest {
99 99
                 "\n" +
100 100
                 "Errors         \t \t seen: 4 times\n";
101 101
 
102
+        String maybe = "name:    Milk        seen: 6 times\n" +
103
+                "=============        =============\n" +
104
+                "Price:   3.23        seen: 5 times\n" +
105
+                "-------------        -------------\n" +
106
+                "Price:   1.23        seen: 1 time\n" +
107
+                "\n" +
108
+                "name:   Bread        seen: 6 times\n" +
109
+                "=============        =============\n" +
110
+                "Price:   1.23        seen: 6 times\n" +
111
+                "-------------        -------------\n" +
112
+                "\n" +
113
+                "name: Cookies        seen: 8 times\n" +
114
+                "=============        =============\n" +
115
+                "Price:   2.25        seen: 8 times\n" +
116
+                "-------------        -------------\n" +
117
+                "\n" +
118
+                "name:  Apples        seen: 4 times\n" +
119
+                "=============        =============\n" +
120
+                "Price:   0.25        seen: 2 times\n" +
121
+                "-------------        -------------\n" +
122
+                "Price:   0.23        seen: 2 times\n" +
123
+                "\n" +
124
+                "Errors               seen: 4 times";
102 125
         String actual = mainTest.readRawDataToString("RawData.txt");
103 126
 
104 127
 
@@ -182,6 +205,7 @@ public class MainTest {
182 205
                 "\n" +
183 206
                 "Errors               seen: 5 times\n";
184 207
         String actual = mainTest.readRawDataToString("TestData.txt");
208
+        System.out.println(actual);
185 209
         Assert.assertEquals(expected, actual);
186 210
 
187 211
     }