-
Notifications
You must be signed in to change notification settings - Fork 61
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
test: JUnit test (Zombie) #12
Open
skwoo1110
wants to merge
146
commits into
arminkz:master
Choose a base branch
from
SoftwareSystem-Project-4:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- Used to explain variable's role - for the code readability
- Used to explain variable's role - for the code readability
- increase readability for number
- increase readability for number
rename & replace magic number
- disconnted the menu screen creation function that was included in GameWindow. - separation of interests
- filename rename GameWindow to GameFrame - filename rename Menu to MenuPanel
- divide with Model, View
- In the existing code, the size of the constructor function was large. - By applying this refactoring, the size of the constructor was reduced and readability was improved through the name of each function.
- By refactoring, the size of the constructor was reduced and readability was improved through the name of each function.
separating View & Model
Plant, Peashooter, FreezePeashooter
rename, extract constant
refactor: rename variable(pea / FreezePea)
refactor: extract constant(START_X,START_Y)
refactor: extract constant(START_X,START_Y)
refactor: extract constant(START_X,START_Y)
extract constant
/** * Purpose: test PlantFactory getInstance when it already exists. * Input: PlantFactory getPlant(ID, x, y) * ID = "Sunflower", x = 40, y = 10 * Expected: * return SUCCESS * testPlant.getCost() = Sunflower.SUNFLOWER_COST * getX() = 40 * getY() = 10 */
This reverts commit d13a05c.
/** * Purpose: test PlantFactory getPlant, plant type is Sunflower * Input: PlantFactory getPlant(type, x, y) * type = "Sunflower", x = 40, y = 10 * Expected: * return SUCCESS * testPlant.getCost() = Sunflower.SUNFLOWER_COST * getX() = 40 * getY() = 10 */
/** * Purpose: test PlantFactory getPlant, plant type is NormalPeashooter * Input: PlantFactory getPlant(type, x, y) * type = "NormalPeashooter", x = 40, y = 10 * Expected: * return SUCCESS * testPlant.getCost() = NormalPeashooter.SUNFLOWER_COST * getX() = 40 * getY() = 10 */
/** * Purpose: test PlantFactory getPlant, plant type is FreezePeashooter * Input: PlantFactory getPlant(type, x, y) * type = "FreezePeashooter", x = 40, y = 10 * Expected: * return SUCCESS * testPlant.getCost() = FreezePeashooter.FREEZE_PEASHOOTER_COST * getX() = 40 * getY() = 10 */
/** * Purpose: test plant value setting * Input: NormalPeashooter(40, 10) setX(newX), setY(newY), setHealth(newHealth) * newX = 400, newY = 100, newHealth = 123 * Expected: * return SUCCESS * getX() = 400 * getY() = 100 * getHealth() = 123 */
Junit Test (Plant)
/** * Purpose: test drawing Sunflower, but graphics is null. * --> Test before plant action runs. * Input: Sunflower(10, 20) * graphics = null * Expected: * NullPointerException */
/** * Purpose: test drawing NormalPeashooter, but graphics is null. * --> Test before plant action runs. * Input: NormalPeashooter(10, 20) * graphics = null * Expected: * NullPointerException */
/** * Purpose: test drawing FreezePeashooter, but graphics is null. * --> Test before plant action runs. * Input: FreezePeashooter(10, 20) * graphics = null * Expected: * NullPointerException */
Junit test (Plant)
create unit-test for State, SunState, Sun Classes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.