Compare commits
2 Commits
4bb1e13f21
...
Skeleton
| Author | SHA1 | Date | |
|---|---|---|---|
| 4fa55c8607 | |||
| fb0e05fd4d |
Binary file not shown.
@@ -7,10 +7,12 @@ import java.util.Map;
|
||||
|
||||
public class AssignmentManager {
|
||||
Map<Integer, Worker> workerMap;
|
||||
List<Task> taskList;
|
||||
int workerIdCounter;
|
||||
|
||||
public AssignmentManager() {
|
||||
workerMap = new HashMap<>();
|
||||
taskList = new ArrayList<>();
|
||||
int workerIdCounter = 1000;
|
||||
}
|
||||
|
||||
@@ -19,4 +21,19 @@ public class AssignmentManager {
|
||||
workerMap.put(workerIdCounter, worker);
|
||||
return workerIdCounter;
|
||||
}
|
||||
public int addTask(int workerId, String name, String description) {
|
||||
return 0;
|
||||
}
|
||||
public Task getTask(int taskId) {
|
||||
return null;
|
||||
}
|
||||
public ArrayList<Task> getTaskList() {
|
||||
return null;
|
||||
}
|
||||
public void editTask(int workerId, int taskId, String name, String description) {
|
||||
|
||||
}
|
||||
public void removeTask(int taskId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
package hhn.temp.project;
|
||||
|
||||
public class Task {
|
||||
String name;
|
||||
String description;
|
||||
int taskId;
|
||||
int workerId;
|
||||
public Task(int taskId, int workerId, String name, String description) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.taskId = taskId;
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public int getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
public int getWorkerId() {
|
||||
return workerId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,5 +58,13 @@ public class GoodCasesTest {
|
||||
manager.removeTask(taskId);
|
||||
assertThrows(manager.getTask(taskId) instanceof IllegalArgumentException);
|
||||
}
|
||||
@Test
|
||||
@DisplayName("Check Getters")
|
||||
public void assertGettersWorkCorrectly() {
|
||||
int workerId = manager.createWorker("Alfred");
|
||||
assertEquals(manager.workerMap.get(workerId).getName(), "Alfred");
|
||||
//This one may be somewhat nonsensical, but it ensures the getId works so one may iterate over the workerMap
|
||||
assertEquals(manager.workerMap.get(workerId).getId(), workerId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user