File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package tasks ;
2+
3+ import exceptions .DukeException ;
4+ import org .junit .jupiter .api .Test ;
5+
6+ import java .time .LocalDateTime ;
7+ import java .time .format .DateTimeFormatter ;
8+
9+ import static org .junit .jupiter .api .Assertions .assertEquals ;
10+
11+ public class DeadlineTest {
12+
13+ @ Test
14+ public void descriptionTest () throws DukeException {
15+ String name = "should output this" ;
16+ LocalDateTime date = LocalDateTime .parse ("10/12/2022 1020" , DateTimeFormatter .ofPattern ("dd/MM/yyyy HHmm" ));
17+ Deadline test = new Deadline (name , date );
18+ assertEquals ("[D][ ] should output this (by 1020, Dec 10 2022)" , test .toString ());
19+ }
20+
21+ @ Test
22+ public void markTest () throws DukeException {
23+ String name = "should output this" ;
24+ LocalDateTime date = LocalDateTime .parse ("10/12/2022 1020" , DateTimeFormatter .ofPattern ("dd/MM/yyyy HHmm" ));
25+ Deadline test = new Deadline (name , date );
26+ test .markAsDone ();
27+ assertEquals ("[D][X] should output this (by 1020, Dec 10 2022)" , test .toString ());
28+ test .markAsUndone ();
29+ assertEquals ("[D][ ] should output this (by 1020, Dec 10 2022)" , test .toString ());
30+ }
31+
32+ }
You can’t perform that action at this time.
0 commit comments