Skip to content

Commit

Permalink
update test and build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
woon17 committed Sep 17, 2019
1 parent 5efce3f commit 6dd3d08
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ checkstyle {
}

group 'duke'
version '0.1.0'
version '0.2'

repositories {
mavenCentral()
Expand All @@ -23,7 +23,7 @@ application {

shadowJar {
archiveBaseName.set("duke")
archiveVersion.set("0.1.3")
archiveVersion.set("0.2")
archiveClassifier.set(null)
archiveAppendix.set(null)
}
Expand All @@ -47,8 +47,4 @@ run{

test {
useJUnitPlatform()

filter {
includeTestsMatching "duke.*"
}
}
10 changes: 5 additions & 5 deletions src/test/java/AddCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import org.junit.jupiter.api.Test;

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

public class AddCommandTest {
private AddCommand cd;
class AddCommandTest {

@Test
public void commandTest() {
cd = new AddCommand("event task /at 12345".split(" ", 2));
assertEquals(false, AddCommand.isValidTime("12345"));
void commandTest() {
AddCommand cd = new AddCommand("event task /at 12345".split(" ", 2));
assertFalse(AddCommand.isValidTime("12345"));
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package duke.exception;

import duke.exception.DukeException;
import org.junit.jupiter.api.Test;

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


class DukeExceptionTest {
DukeException test;

@Test
public void exceptionTest() {
test = new DukeException("test for DukeException");
void exceptionTest() {
DukeException test = new DukeException("test for DukeException");
assertEquals(" ☹ OOPS!!! " + test.getMessage(),
" ☹ OOPS!!! " + "test for DukeException");
}
Expand Down
13 changes: 5 additions & 8 deletions src/test/java/DukeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@
import duke.command.ExitCommand;
import duke.task.Task;
import duke.task.Todo;
import duke.ui.Storage;
import duke.ui.TaskList;
import org.junit.jupiter.api.Test;

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

public class DukeTest {
private Storage storage;
private TaskList taskList;


@Test
public void taskListTest() {
taskList = new TaskList();
void taskListTest() {
TaskList taskList = new TaskList();
Task task = new Todo("task1");
taskList.addTask(task);
assertEquals(task, taskList.getTaskList().get(0));
Expand All @@ -24,8 +21,8 @@ public void taskListTest() {
}

@Test
public void exitTest() {
void exitTest() {
Command c = new ExitCommand();
assertEquals(true, c.isExit());
assertTrue(c.isExit());
}
}

0 comments on commit 6dd3d08

Please sign in to comment.