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 task ;
2+
3+ import org .junit .jupiter .api .Test ;
4+
5+ import static org .junit .jupiter .api .Assertions .*;
6+
7+ class EventsTest {
8+
9+ Events event1 = new Events ("event1" , null );
10+ Events event2 = new Events ("event2" , "NUS" );
11+
12+ @ Test
13+ void getTypeIcon () {
14+ String actualOutput = event1 .getTypeIcon ();
15+ String expectedOutput = "[E]" ;
16+
17+ assertEquals (actualOutput , expectedOutput );
18+ }
19+
20+ @ Test
21+ void testGetDescription_noVenue () {
22+ String actualOutput = event1 .getDescription ();
23+ String expectedOutput = "event1" ;
24+
25+ assertEquals (actualOutput , expectedOutput );
26+ }
27+
28+ @ Test
29+ void testGetDescription () {
30+ String actualOutput = event2 .getDescription ();
31+ String expectedOutput = "event2 (at: NUS)" ;
32+
33+ assertEquals (actualOutput , expectedOutput );
34+ }
35+
36+ @ Test
37+ void testTokenize () {
38+ String actualOutput = event2 .tokenize ();
39+ String expectedOutput = "E|0|event2|NUS" ;
40+
41+ assertEquals (actualOutput , expectedOutput );
42+ }
43+
44+ @ Test
45+ void testTokenize_noVenue () {
46+ String actualOutput = event1 .tokenize ();
47+ String expectedOutput = "E|0|event1" ;
48+
49+ assertEquals (actualOutput , expectedOutput );
50+ }
51+
52+ }
You can’t perform that action at this time.
0 commit comments