Just a commit to push the build files so I can push
This commit is contained in:
@@ -24,7 +24,7 @@ public class AssignmentManager {
|
||||
<span class="fc" id="L24"> return workerIdCounter;</span>
|
||||
}
|
||||
public int addTask(int workerId, String name, String description) {
|
||||
<span class="pc bpc" id="L27" title="2 of 6 branches missed."> if (!workerMap.containsKey(workerId) || name == null || description == null) {</span>
|
||||
<span class="pc bpc" id="L27" title="1 of 6 branches missed."> if (!workerMap.containsKey(workerId) || name == null || description == null) {</span>
|
||||
<span class="fc" id="L28"> throw new IllegalArgumentException("WorkerId must exist and name or description can't be null");</span>
|
||||
}
|
||||
<span class="fc" id="L30"> Task task = new Task(++taskIdCounter, workerId, name, description, this);</span>
|
||||
@@ -41,7 +41,7 @@ public class AssignmentManager {
|
||||
<span class="fc" id="L41"> return taskMap;</span>
|
||||
}
|
||||
public void editTask(int workerId, int taskId, String name, String description) {
|
||||
<span class="pc bpc" id="L44" title="1 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
|
||||
<span class="fc bfc" id="L44" title="All 4 branches covered."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
|
||||
<span class="fc" id="L45"> throw new IllegalArgumentException("Task Id or Worker Id does not exist");</span>
|
||||
}
|
||||
<span class="fc" id="L47"> Task task = taskMap.get(taskId);</span>
|
||||
@@ -49,21 +49,21 @@ public class AssignmentManager {
|
||||
<span class="fc" id="L49"> task.setDescription(description);</span>
|
||||
<span class="fc" id="L50"> }</span>
|
||||
public void removeTask(int taskId) {
|
||||
<span class="pc bpc" id="L52" title="1 of 2 branches missed."> if (!taskMap.containsKey(taskId)) {</span>
|
||||
<span class="nc" id="L53"> throw new IllegalArgumentException("Task Id does not exist");</span>
|
||||
<span class="fc bfc" id="L52" title="All 2 branches covered."> if (!taskMap.containsKey(taskId)) {</span>
|
||||
<span class="fc" id="L53"> throw new IllegalArgumentException("Task Id does not exist");</span>
|
||||
}
|
||||
<span class="fc" id="L55"> taskMap.remove(taskId);</span>
|
||||
<span class="fc" id="L56"> }</span>
|
||||
public void finishTask(int workerId, int taskId) {
|
||||
<span class="pc bpc" id="L58" title="2 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
|
||||
<span class="nc" id="L59"> throw new IllegalArgumentException("Task Id or Worker Id does not exist");</span>
|
||||
<span class="pc bpc" id="L58" title="1 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
|
||||
<span class="fc" id="L59"> throw new IllegalArgumentException("Task Id or Worker Id does not exist");</span>
|
||||
}
|
||||
<span class="fc" id="L61"> Task task = taskMap.get(taskId);</span>
|
||||
<span class="fc" id="L62"> task.setTaskState(TaskState.FINISHED);</span>
|
||||
<span class="fc" id="L63"> }</span>
|
||||
public void unfinishTask(int workerId, int taskId) {
|
||||
<span class="pc bpc" id="L65" title="2 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
|
||||
<span class="nc" id="L66"> throw new IllegalArgumentException("Task Id or Worker Id does not exist");</span>
|
||||
<span class="pc bpc" id="L65" title="1 of 4 branches missed."> if (!workerMap.containsKey(workerId) || !taskMap.containsKey(taskId)) {</span>
|
||||
<span class="fc" id="L66"> throw new IllegalArgumentException("Task Id or Worker Id does not exist");</span>
|
||||
}
|
||||
<span class="fc" id="L68"> Task task = taskMap.get(taskId);</span>
|
||||
<span class="fc" id="L69"> task.setTaskState(TaskState.IN_PROGRESS);</span>
|
||||
|
||||
Reference in New Issue
Block a user