Skip to content

Commit

Permalink
add A-JUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuChao93 committed Feb 9, 2020
1 parent 757009d commit 6e41e00
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

import java.io.FileNotFoundException;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

public class DukeException extends Exception {
public DukeException(String message){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package lc.duke;

import lc.duke.DukeException;
package lcduke;

public class Parser {
static boolean isProblem = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

public abstract class Task {
protected String description;
Expand All @@ -14,9 +14,11 @@ public Task(String description) {
public String getStatusIcon() {
return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
}

public void markAsDone() {
this.isDone = true;
}

public boolean getDone(){
return isDone;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package lc.duke;
package lcduke;

import static java.lang.Integer.parseInt;
import java.text.ParseException;

import static java.lang.Integer.parseInt;

public class TaskList {
static Task[] totalTasks = new Task[100];
static int totalTasksCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package lc.duke;
package lcduke;

public class Todo extends Task{
public class Todo extends Task {
public Todo(String description) {
super(description);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lc.duke;
package lcduke;

import java.util.Scanner;

Expand Down
11 changes: 11 additions & 0 deletions src/test/java/lcduke/DukeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package lcduke;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class DukeTest {
@Test
public void dummyTest(){
assertEquals(2, 2);
}
}
12 changes: 12 additions & 0 deletions src/test/java/lcduke/TaskTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package lcduke;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TaskTest {
@Test
public void TestGetDone(){
Task task1 = new Todo("todo read book");
assertEquals(false, task1.getDone());
}
}
15 changes: 15 additions & 0 deletions src/test/java/lcduke/UiTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package lcduke;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class UiTest {
@Test
public void testByeOutput(){
// assertEquals(" ____________________________________________________________"
// + " Bye. Hope to see you again soon!"
// + " ____________________________________________________________",
// new Ui().bye());
}
}

0 comments on commit 6e41e00

Please sign in to comment.