File tree Expand file tree Collapse file tree
src/test/java/florizz/command Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package florizz .command ;
2+
3+ import florizz .core .FlorizzException ;
4+ import florizz .core .Ui ;
5+ import florizz .objects .Bouquet ;
6+ import org .junit .jupiter .api .Test ;
7+
8+ import java .util .ArrayList ;
9+
10+ import static org .junit .jupiter .api .Assertions .assertEquals ;
11+
12+ public class AddBouquetTest {
13+ @ Test
14+ void testAddCommandExecute (){
15+ Bouquet testBouquet = new Bouquet ("for testing" );
16+ Ui ui = new Ui ();
17+ ArrayList <Bouquet > controlList = new ArrayList <>();
18+ ArrayList <Bouquet > testList = new ArrayList <>();
19+ controlList .add (testBouquet );
20+ Command testAddBouquetCommand = new AddBouquetCommand (testBouquet );
21+ try {
22+ testAddBouquetCommand .execute (testList , ui );
23+ }
24+ catch (FlorizzException error ){
25+ ui .printError (error );
26+ }
27+ assertEquals (controlList , testList );
28+ }
29+ }
Original file line number Diff line number Diff line change 1+ package florizz .command ;
2+
3+ import florizz .core .FlorizzException ;
4+ import florizz .core .Ui ;
5+ import florizz .objects .Bouquet ;
6+ import org .junit .jupiter .api .Test ;
7+
8+ import java .util .ArrayList ;
9+
10+ import static org .junit .jupiter .api .Assertions .assertEquals ;
11+
12+ public class DeleteBouquetTest {
13+ @ Test
14+ void testAddCommandExecute (){
15+ Bouquet testBouquet = new Bouquet ("for testing" );
16+ Ui ui = new Ui ();
17+ ArrayList <Bouquet > controlList = new ArrayList <>();
18+ ArrayList <Bouquet > testList = new ArrayList <>();
19+ controlList .add (testBouquet );
20+ testList .add (testBouquet );
21+ Command testDeleteBouquetCommand = new DeleteBouquetCommand (testBouquet );
22+ controlList .remove (testBouquet );
23+ try {
24+ testDeleteBouquetCommand .execute (testList , ui );
25+ }
26+ catch (FlorizzException error ){
27+ ui .printError (error );
28+ }
29+ assertEquals (controlList , testList );
30+ }
31+ }
Original file line number Diff line number Diff line change 1- package florizz .objects ;
1+ package florizz .command ;
22
33import florizz .command .ExitCommand ;
44import florizz .core .Ui ;
5+ import florizz .objects .Bouquet ;
56import org .junit .jupiter .api .Test ;
67
78import java .util .ArrayList ;
Original file line number Diff line number Diff line change 1- package florizz .objects ;
1+ package florizz .command ;
22
33import florizz .command .HelpCommand ;
44import florizz .core .Ui ;
5+ import florizz .objects .Bouquet ;
56import org .junit .jupiter .api .Test ;
67
78import java .util .ArrayList ;
You can’t perform that action at this time.
0 commit comments