forked from nus-cs2113-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from BestDownLoader365/command_and_Junit_test
test how Junit works
- Loading branch information
Showing
8 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
package command; | ||
|
||
import java.util.ArrayList; | ||
|
||
public abstract class Command { | ||
|
||
protected String commandDescription; | ||
protected ArrayList<ArrayList<Character>> currentMap; | ||
public abstract void execute(); | ||
public Command(){ | ||
commandDescription = "Impossible"; | ||
currentMap = null; | ||
} | ||
public String getCommandDescription(){ | ||
return commandDescription; | ||
} | ||
public ArrayList<ArrayList<Character>> getCurrentMap(){ | ||
return currentMap; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
public class InteractingCommand extends MapMoveCommand { | ||
@Override | ||
public void execute() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package command; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
|
||
public class CommandTest { | ||
Command a; | ||
@BeforeEach | ||
void setup(){ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package command.fight; | ||
|
||
import command.Command; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class FightCommandTest { | ||
Command a; | ||
@BeforeEach | ||
void setup() { | ||
a = new FightingCommand(); | ||
} | ||
|
||
@Test | ||
void fightExecuteCorrectly() { | ||
assertEquals("FIGHT!", a.getCommandDescription()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package command.mapmove; | ||
|
||
public class MapMoveCommandTest { | ||
} |