Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Yan Lyn] iP #469

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3b19ba1
Add Gradle support
May 24, 2020
652a853
no message
yanlynnnnn Aug 17, 2020
2c4ba83
Revert "no message"
yanlynnnnn Aug 17, 2020
6f3abf9
Revert "Revert "no message""
yanlynnnnn Aug 17, 2020
58cbb14
Revert "Revert "Revert "no message"""
yanlynnnnn Aug 17, 2020
993e55a
Level 1
yanlynnnnn Aug 17, 2020
c73a6d6
Level 2
yanlynnnnn Aug 17, 2020
51a3fbe
Level 3
yanlynnnnn Aug 17, 2020
03191ac
no message
yanlynnnnn Aug 17, 2020
382e15f
Merge branch 'master' into HEAD
yanlynnnnn Aug 19, 2020
b81969c
no message
yanlynnnnn Aug 20, 2020
98ae8d3
no message
yanlynnnnn Aug 20, 2020
c7c32f0
Level 7
yanlynnnnn Aug 24, 2020
853e69f
Level 8
yanlynnnnn Aug 24, 2020
3f6e141
no message
yanlynnnnn Aug 26, 2020
b6b321f
A-OOP
yanlynnnnn Aug 26, 2020
2ec6df1
A-JUnit
yanlynnnnn Aug 26, 2020
6f9552b
Merge branch 'branch-Level-8' into branch-Level-7
yanlynnnnn Aug 26, 2020
1434336
Merge branch 'branch-Level-7'
yanlynnnnn Aug 26, 2020
49a8bb8
A-JavaDoc
yanlynnnnn Aug 27, 2020
0c03fe6
Revert "A-JavaDoc"
yanlynnnnn Aug 27, 2020
3a58acb
A-JavaDoc
yanlynnnnn Aug 27, 2020
e58cf6f
A-CodingStandard
yanlynnnnn Aug 27, 2020
507ebfa
Level-9
yanlynnnnn Aug 27, 2020
a7eb991
Merge branch 'branch-A-CodingStandard'
yanlynnnnn Aug 27, 2020
cc5f84a
Merge branch 'branch-Level-9'
yanlynnnnn Aug 27, 2020
6b8d8bb
Level-9
yanlynnnnn Aug 27, 2020
44216fa
Week3
yanlynnnnn Aug 27, 2020
a75fcee
build.gradle: Update version to 8.29
Aug 29, 2020
f31911a
Merge commit 'a75fceeb74708da6ac524c08ef526d38e60ee56b'
yanlynnnnn Aug 30, 2020
9205c0b
Level-10
yanlynnnnn Sep 3, 2020
4fc5c2d
GUI for Duke
yanlynnnnn Sep 3, 2020
311532c
Edits based on pull request review
yanlynnnnn Sep 5, 2020
829c423
Revert "Edits based on pull request review"
yanlynnnnn Sep 6, 2020
1046ae3
A-CodeQuality
yanlynnnnn Sep 6, 2020
398c649
Merge branch 'branch-A-CodeQuality'
yanlynnnnn Sep 6, 2020
5ff3a7e
Fixed bug in 'findTask' method
yanlynnnnn Sep 6, 2020
c06c2fa
Improved Documentation
yanlynnnnn Sep 7, 2020
918b69b
BCD-extension
yanlynnnnn Sep 7, 2020
ee08b5a
A-UserGuide
yanlynnnnn Sep 13, 2020
26cedef
Improve GUI and UG
yanlynnnnn Sep 15, 2020
7bb129f
Add Highlights on UG
yanlynnnnn Sep 15, 2020
625bac9
Improve UG and GUI
yanlynnnnn Sep 15, 2020
fe835e9
improve ug
yanlynnnnn Sep 15, 2020
40967de
finalize ug
yanlynnnnn Sep 15, 2020
dd4fe02
no message
yanlynnnnn Sep 17, 2020
0c02323
Empty Commit
yanlynnnnn Sep 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added listStore.ser
Binary file not shown.
418 changes: 411 additions & 7 deletions src/main/java/Duke.java

Large diffs are not rendered by default.

382 changes: 382 additions & 0 deletions src/main/java/Duke.java.orig

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions src/test/java/DukeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;

public class DukeTest {
@Test
public void dummyTest() {
assertEquals(2,2);
}

@Test
public void todoExceptionTest() throws Duke.DukeException {
try {
Duke.TaskList Tasks = new Duke.TaskList(new ArrayList<>());
Tasks.taskTodo("todo");
} catch (Duke.DukeException e) {
assertEquals("OOPS!!! The description of a todo cannot be empty.", e.msg);
}
}

@Test
public void deadlineExceptionTest() throws Duke.DukeException {
try {
Duke.TaskList Tasks = new Duke.TaskList(new ArrayList<>());
Tasks.taskDeadline("deadline");
} catch (Duke.DukeException e) {
assertEquals("OOPS!!! The description of a deadline cannot be empty.", e.msg);
}
}

@Test
public void parserExceptionTest() throws Duke.DukeException {
try {
Duke.Parser testParser = new Duke.Parser("blah", new Duke.TaskList());
testParser.parse();
} catch (Duke.DukeException e) {
assertEquals("OOPS!!! I'm sorry, but I don't know what that means :-(", e.msg);
}
}




}

Empty file added text-ui-test/Downloading
Empty file.
24 changes: 24 additions & 0 deletions text-ui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,27 @@ Hello from
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|

Hello! I'm Duke
What can I do for you?
Got it. I've added this task:
[T][x] borrow book
Now you have 1 tasks in the list
Got it. I've added this task:
[D][x] return book (by: Sunday)
Now you have 2 tasks in the list
Got it. I've added this task:
[E][x] project meeting (at: Mon 2-4pm)
Now you have 3 tasks in the list
Here are the tasks in your list:
1. [T][x] borrow book
2. [D][x] return book (by: Sunday)
3. [E][x] project meeting (at: Mon 2-4pm)
Nice! I've marked this task as done:
[/] return book (by: Sunday)
Nice! I've marked this task as done:
[/] borrow book
Here are the tasks in your list:
1. [T][/] borrow book
2. [D][/] return book (by: Sunday)
3. [E][x] project meeting (at: Mon 2-4pm)
Bye. Hope to see you again soon!
Empty file added text-ui-test/Pouring
Empty file.
8 changes: 8 additions & 0 deletions text-ui-test/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
todo borrow book
deadline return book /by Sunday
event project meeting /at Mon 2-4pm
list
done 2
done 1
list
bye
6 changes: 3 additions & 3 deletions text-ui-test/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ then
fi

# compile the code into the bin folder, terminates if error occurred
if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/Duke.java
if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/*.java
then
echo "********** BUILD FAILURE **********"
exit 1
Expand All @@ -27,12 +27,12 @@ cp EXPECTED.TXT EXPECTED-UNIX.TXT
dos2unix ACTUAL.TXT EXPECTED-UNIX.TXT

# compare the output to the expected output
diff ACTUAL.TXT EXPECTED-UNIX.TXT
diff ACTUAL.TXT EXPECTED-UNIX.TXT | cat -t
if [ $? -eq 0 ]
then
echo "Test result: PASSED"
exit 0
else
echo "Test result: FAILED"
exit 1
fi
fi