Wrote all the Tests for the Scanner UI
This commit is contained in:
@@ -26,11 +26,14 @@ public class AssignmentManager {
|
||||
workerMap.put(workerIdCounter, worker);
|
||||
return workerIdCounter;
|
||||
}
|
||||
public void removeWorker(int workerId) {
|
||||
workerMap.remove(workerId);
|
||||
}
|
||||
public int addTask(int workerId, String name, String description) {
|
||||
if (!workerMap.containsKey(workerId) || name == null || description == null) {
|
||||
throw new IllegalArgumentException("WorkerId must exist and name or description can't be null");
|
||||
}
|
||||
Task task = new Task(++taskIdCounter, workerId, name, description, this);
|
||||
Task task = new Task(++taskIdCounter, workerId, name, description);
|
||||
taskMap.put(taskIdCounter, task);
|
||||
return taskIdCounter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user