Skip to content

Commit

Permalink
Sarthak | Renames TaskList to TaskListRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
SarthakMakhija committed Jan 9, 2025
1 parent 7e4730d commit 36a1d8f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<programs>
<program>
<id>task-list</id>
<mainClass>com.codurance.training.tasks.TaskList</mainClass>
<mainClass>com.codurance.training.TaskListRunner</mainClass>
</program>
</programs>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.codurance.training.tasks;
package com.codurance.training;

import com.codurance.training.commands.CommandLine;
import com.codurance.training.commands.Commands;

import java.io.Writer;

public final class TaskList {
public final class TaskListRunner {
private final Commands commands;

public TaskList(Writer writer) {
public TaskListRunner(Writer writer) {
commands = new Commands(writer);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package com.codurance.training.tasks;
package com.codurance.training;

import org.junit.Test;

import java.io.StringWriter;

import static org.junit.Assert.assertEquals;

public class TaskListTest {
public class TaskListRunnerTest {

@Test
public void executeWithAdditionOfAProjectContainingOneTask() throws Exception {
StringWriter writer = new StringWriter();
TaskList taskList = new TaskList(writer);
taskList.execute("add project caizin");
taskList.execute("add task caizin Task1");
taskList.execute("show");
TaskListRunner taskListRunner = new TaskListRunner(writer);
taskListRunner.execute("add project caizin");
taskListRunner.execute("add task caizin Task1");
taskListRunner.execute("show");

String expected = "caizin\n" + "[ ] 1: Task1" + "\n";
assertEquals(expected, writer.toString());
Expand All @@ -23,11 +23,11 @@ public void executeWithAdditionOfAProjectContainingOneTask() throws Exception {
@Test
public void executeWithAdditionOfAProjectContainingACoupleOfTasks() throws Exception {
StringWriter writer = new StringWriter();
TaskList taskList = new TaskList(writer);
taskList.execute("add project caizin");
taskList.execute("add task caizin Task1");
taskList.execute("add task caizin Task2");
taskList.execute("show");
TaskListRunner taskListRunner = new TaskListRunner(writer);
taskListRunner.execute("add project caizin");
taskListRunner.execute("add task caizin Task1");
taskListRunner.execute("add task caizin Task2");
taskListRunner.execute("show");

String expected = "caizin\n" + "[ ] 1: Task1" + "\n" + "[ ] 2: Task2" + "\n";
assertEquals(expected, writer.toString());
Expand All @@ -36,12 +36,12 @@ public void executeWithAdditionOfAProjectContainingACoupleOfTasks() throws Excep
@Test
public void executeWithAdditionOfAProjectContainingACoupleOfTasksAndCheckOneOfThem() throws Exception {
StringWriter writer = new StringWriter();
TaskList taskList = new TaskList(writer);
taskList.execute("add project caizin");
taskList.execute("add task caizin Task1");
taskList.execute("add task caizin Task2");
taskList.execute("check 1");
taskList.execute("show");
TaskListRunner taskListRunner = new TaskListRunner(writer);
taskListRunner.execute("add project caizin");
taskListRunner.execute("add task caizin Task1");
taskListRunner.execute("add task caizin Task2");
taskListRunner.execute("check 1");
taskListRunner.execute("show");

String expected = "caizin\n" + "[x] 1: Task1" + "\n" + "[ ] 2: Task2" + "\n";
assertEquals(expected, writer.toString());
Expand All @@ -50,13 +50,13 @@ public void executeWithAdditionOfAProjectContainingACoupleOfTasksAndCheckOneOfTh
@Test
public void executeWithAdditionOfAProjectContainingACoupleOfTasksAndUncheckOneOfThem() throws Exception {
StringWriter writer = new StringWriter();
TaskList taskList = new TaskList(writer);
taskList.execute("add project caizin");
taskList.execute("add task caizin Task1");
taskList.execute("add task caizin Task2");
taskList.execute("check 1");
taskList.execute("uncheck 1");
taskList.execute("show");
TaskListRunner taskListRunner = new TaskListRunner(writer);
taskListRunner.execute("add project caizin");
taskListRunner.execute("add task caizin Task1");
taskListRunner.execute("add task caizin Task2");
taskListRunner.execute("check 1");
taskListRunner.execute("uncheck 1");
taskListRunner.execute("show");

String expected = "caizin\n" + "[ ] 1: Task1" + "\n" + "[ ] 2: Task2" + "\n";
assertEquals(expected, writer.toString());
Expand Down

0 comments on commit 36a1d8f

Please sign in to comment.