Skip to content
Snippets Groups Projects
Commit c7061f04 authored by Axel's avatar Axel
Browse files

unitTests

parent 740f165e
No related branches found
No related tags found
No related merge requests found
...@@ -40,8 +40,10 @@ public class HashMapTest { ...@@ -40,8 +40,10 @@ public class HashMapTest {
} }
}; };
//fixme: use the function from the class .... obviously
public ArrayList<Map<String, Double>> cheatChecker(ArrayList<Map<String, Double>> workRatings, String method) { public ArrayList<Map<String, Double>> cheatChecker(ArrayList<Map<String, Double>> workRatings, String method) {
ArrayList<Map<String, Double>> result = new ArrayList<>(); ArrayList<Map<String, Double>> result = new ArrayList<>();
//todo: magicString sollte Enum sein um nutzbarer zu sein.
if (method.equals("median")) { if (method.equals("median")) {
workRatings.sort(byMean); workRatings.sort(byMean);
result.add(workRatings.get(workRatings.size() / 2)); //in favor of student result.add(workRatings.get(workRatings.size() / 2)); //in favor of student
...@@ -116,6 +118,7 @@ public class HashMapTest { ...@@ -116,6 +118,7 @@ public class HashMapTest {
workRatings.add(work3); workRatings.add(work3);
workRatings.add(work4); workRatings.add(work4);
//fixme: workRating in class. cheatchecker extends Hashmap<String, Double>!?
System.out.println(cheatChecker(workRatings, "median").toString()); System.out.println(cheatChecker(workRatings, "median").toString());
System.out.println(cheatChecker(workRatings, "variance").toString()); System.out.println(cheatChecker(workRatings, "variance").toString());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment